summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QRasterPlatformPixmap::createPixmapForImage(): preserve DPRFriedemann Kleint2017-02-061-0/+14
| | | | | | | | | | Remove the line setting the DPR from the source; the image is moved. Task-number: QTBUG-58653 Task-number: QTBUG-58645 Change-Id: I2de94681459dba1d69dee06da44617fb9fa35bcc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Accept error margin in QGlyphRun/QStaticText test for decorationsEskil Abrahamsen Blomfeldt2017-02-022-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | When calculating the width of a text for drawing decorations on top, we use the effective advance of the whole text after it has been through the shaper. However, in the case of QStaticText and QGlyphRun, there is shortcut: Since we only have the glyph indexes and position of each glyph, we use the position + advance of the right-most glyph to find the right-most edge of the decoration. For this, however, we use the advance of the glyph *out of context* of the rest of the string, because the whole idea is to avoid doing the shaping of the string with every draw call. In some rare cases, the advance of the right-most character, in the context of the string, is different from the advance of the standalone glyph. Now, one way of fixing this would be to store the width of the text in QStaticText and QGlyphRun, but since it is a very rare artifact which is barely visible, I have opted to just work around it in the test instead, the workaround being to force integer metrics so that we don't get the small 0.2 pixel error. Task-number: QTBUG-55217 Change-Id: I8d16d52f2ef27275cabb7d3865aeeaa31617ba3d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Adjust some tests to pass with latest HB-NG changesKonstantin Ritt2017-02-021-7/+9
| | | | | | | | Recent HB changed the way of handling ZWJ/ZWNJ to be more in par with other engines. Change-Id: I8abacd195e4b247c8fa6d91ef1086e74da0a1efb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix tst_QFontMetrics::elidedMultiLengthF with some fontsEskil Abrahamsen Blomfeldt2017-02-021-6/+6
| | | | | | | | The QFontMetricsF version of the test should not truncate the returned values, as the results may then be wrong. Change-Id: I17f97f846bb723709e695e8866e437d6888d275b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix tst_QTextScriptEngine::thaiWithZWJ() on OpenSUSEEskil Abrahamsen Blomfeldt2017-02-021-0/+3
| | | | | | | | | | OpenSUSE has a bitmap font called "Waree" while the test is created for the TrueType font which is available on Ubuntu. The style names are different, so we can use that to check that we have the right one. Change-Id: I808d0d1ecde9f10ed7730dc76ab3818490002ba9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'gerrit/dev' into HEADOswald Buddenhagen2017-02-0150-362/+1146
|\
| * New qfloat16 classGlen Mabey2017-01-313-0/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This constitutes a fairly complete submission of an entirely new floating point type which conforms to IEEE 754 as a 16-bit storage class. Conversion between qfloat16 and float is currently performed through a sequence of lookup tables. Global-level functions qRound(), qRound64(), qFuzzyCompare(), qFuzzyIsNull(), and qIsNull() each with a qfloat16 parameter have been included for completeness. [ChangeLog][QtCore] Added new qfloat16 class. Change-Id: Ia52eb27846965c14f8140c00faf5ba33c9443976 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * tst_qvariant: fix comparison ambiguity for QMetaEnum valueGlen Mabey2017-01-311-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Under certain circumstances, VS2015 reported ambiguous options in using the operator>(Enum,int) operator. This change adds a static_cast<qint64> to remove any ambiguity. In the process of testing this change, a gap in the existing logic was identified: the handling (just in the test code) of large negative enum values. Consequently, and additional test case was added, and additional if-conditions were added to account for that case. Change-Id: Ife2c471ba4caa4b9a0107722042114e58145c4d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fix 2 clang warningsErik Verbruggen2017-01-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first one was already suppressed for GCC, so also do that for clang: /Users/erik/dev/qt5-dev/qtbase/tests/auto/corelib/tools/qstring/tst_qstring.cpp:1076:16: warning: format string is not a string literal (potentially insecure) [-Wformat-security] a.sprintf( zero ); ^~~~ /Users/erik/dev/qt5-dev/qtbase/tests/auto/corelib/tools/qstring/tst_qstring.cpp:1076:16: note: treat the string as an argument to avoid this a.sprintf( zero ); ^ "%s", The second one could also occur with other compilers, so fix it in a generic way. /Users/erik/dev/qt5-dev/qtbase/tests/auto/corelib/tools/qstring/tst_qstring.cpp:6382:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] string.repeated(3); ^~~~~~~~~~~~~~~ ~ 2 warnings generated. Change-Id: Id999179e795580a37b5be673ee54d6fa1a006dd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-3013-38/+86
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| | * Accept all formatting characters as valid inputEskil Abrahamsen Blomfeldt2017-01-261-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 7896ae052ad2c0c6ae2ebfc64cc2f525185198a8. The previous change focused only on ZWJ and ZWNJ, but there are many other formatting characters that we need to support and that may be rejected by the German keyboard-hack. This opens up for all characters in the Other_Format category. Task-number: QTBUG-58364 Change-Id: Idd967a9ae5b12060c851f6030b7e019508561696 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Plug leaks in tests/auto/dbusMarc Mutz2017-01-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In tst_QDBusMetaObject::types(), hold a QMetaObject obtained from QDBusMetaObject::createMetaObject() in a QScopedPointer instead of leaking it. Use correct return value type. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/dbus. Change-Id: I1df7f8e42d45f40ecf381fe7b684a8ab5ebee675 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Plug remaining memleaks in tests/auto/widgets/itemviewsMarc Mutz2017-01-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... on Linux AMD64 builds. Pass QObject parents to QObjects otherwise leaked. Change-Id: Ia4f0ad2fdc4ef62a3d35a2cfca74965f79692da3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Plug memleaks in tst_QHeaderViewMarc Mutz2017-01-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The char* returned from QTest::toString() calls must be manually delete[]ed. Change-Id: Iad078e8741e3e97693b1a417693f414b3fb3ec09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Plug memleaks in tst_QTreeViewMarc Mutz2017-01-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | Forgot to delete QAIMs without parent. Change-Id: I9c914e841123ee250fb977c45a84870463288d9b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * tst_QTreeWidget: plug memleaksMarc Mutz2017-01-261-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Taken QTreeWidgetItems need to be deleted, as do items created without a parent, and widgets without parent. Change-Id: I7ffa69903af9a1b92ba308f9f9416aec1d6d975f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Plug memleaks in tst_QAbstractItemViewMarc Mutz2017-01-261-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Styles need to be deleted manually... Change-Id: Ic4193d22a57801127e994062cade7cb9ef6f34d8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QVariant of nullptr should always be nullAllan Sandfeld Jensen2017-01-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implements isNull for QVariants of a nullptr so they always return true to isNull(), instead of depending on how they were constructed. Task-number: QTBUG-58296 Change-Id: Ibddec795cdadedef7e17d22c265c29e752d8f99f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Improve QTest::qWait() precision and switch to QDeadlineTimerAllan Sandfeld Jensen2017-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Do not wait up to the timeout ms after already having waited several times. At the same time upgrade to using the QDeadlineTimer which is designed for this purpose. Change-Id: Iaf5e4f4655605d5143ce91040c6eb6706752e504 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Stabilize tst_QPropertyAnimation::noStartValue()Friedemann Kleint2017-01-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the qWait() and introduce a QTRY_COMPARE() checking for the end value first. Task-number: QTBUG-58402 Change-Id: I2d3758178de5f67881008f28c406076ad27c4a90 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| | * Cocoa: fix crash regression in qt_mac_create_nsimage()Oleg Yadrov2017-01-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regression was introduced in d8857f21ac264. The original change was meant to fix support for SVG icons, but failed to take into account a valid QIcon with no sizes, but which is also unable to create a pixmap for the requested size. Task-number: QTBUG-58344 Change-Id: I7ac1dbfaf6e3dab8581fe4b33c814e2517fcdba8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * | QSizePolicy: add a transposed() methodMarc Mutz2017-01-281-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some situations, this allows for nicer code. It's also possible to make this constexpr in C++11, whereas the mutable transpose() would require C++14-style constexpr. The new function should also be faster, since it just swaps the member variables. Because of constexpr-function limitations, the way the return value is constructed needs to depend on the level of the compiler's C++11 support. This is not the only class that requires uniform init to provide a fully constexpr interface (QUuid and QBasicAtomic come to mind), so this should probably be generalized across Qt at some point. Added tests. [ChangeLog][QtWidgets][QSizePolicy] Added transposed() method. Change-Id: Ic1077a0d5a861e7c63bd1daeeb42b97c3a2f71ef Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * | QSizePolicy: add some constexprMarc Mutz2017-01-282-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add a basic test for constexpr expressions involving QSizePolicy. GCC < 4.8.0 has problems with initializing variant members in constexpr ctors: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54922 Instead of revoking its Q_COMPILER_CONSTEXPR, which is a source-incompatible change, simply note the fact so we can selectively provide constexpr for QSizePolicy. Change-Id: Iba8e5a7cdf847d73e8e2b6bb6211fb3c9846aa0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | tests/auto/corelib/animation: clean upMarc Mutz2017-01-263-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - port from inefficient QLists to QVector - mark types held in Qt containers (incl. QVariant) as Q_MOVABLE/PRIMITIVE_TYPE - remove pointless user-defined copy special members which prevent the class from having nothrow move special members Fixes errors reported by my local tree's static checks. Change-Id: If3910484cea81a8e2c5ab737908c9443f75782c5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QHostAddress: add missing op!=(SpecialAddress, QHostAddress)Marc Mutz2017-01-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The equality operator was supplied, but this one was missing. [ChangeLog][QtNetwork][QHostAddress] Added op!=(SpecialAddress, QHostAddress). Change-Id: Iad9c55fa0ee7a8e97d5e4ea4be0605b8b74649d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | tst_qgraphicsview: use new QTest::addRow() moreMarc Mutz2017-01-262-109/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... for calculated test data names. That involved removing the leading ", " from test name literals (folding it into the format string) and porting from some QString code to QByteArray to make the result usable with addRow(), which does not support %ls... Change-Id: Icb2344778203f10939ae46b9e46872101f3878a9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Fix QString comparison on Aarch64Erik Verbruggen2017-01-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an off-by-one error in the while loop for aarch64: we start counting at 0 for the first position, so the last valid input position is "a+7", not 8. This wasn't covered by the tests, nor was the SSE2 version, so now there are also tests for both versions. Change-Id: I7eb8c5708e6179f45ea56885b0e66e1a37969c1d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Use QImage::reinterpretAsFormat in QPixmapAllan Sandfeld Jensen2017-01-261-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new QImage method instead of operating on private API. At the same time the code is improved to ensure the QImage is detached. Change-Id: Ia015c0bb18d7bc62da38397594730254843e5a0d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| * | Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/devLiang Qi2017-01-2629-202/+592
| |\ \
| | * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-2529-202/+592
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/common/msvc-version.conf mkspecs/common/winrt_winphone/qmake.conf mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/qt.prf mkspecs/features/uikit/default_post.prf mkspecs/features/winrt/default_pre.prf mkspecs/winphone-arm-msvc2013/qmake.conf mkspecs/winphone-x86-msvc2013/qmake.conf mkspecs/winrt-arm-msvc2013/qmake.conf mkspecs/winrt-x64-msvc2013/qmake.conf mkspecs/winrt-x86-msvc2013/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/gui/kernel/qwindowsysteminterface.cpp src/network/kernel/qhostaddress.cpp src/plugins/platforms/mirclient/qmirclientplugin.cpp src/plugins/platforms/mirclient/qmirclientplugin.h src/widgets/util/qsystemtrayicon.cpp tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp tools/configure/Makefile.mingw tools/configure/Makefile.win32 Done-with: Jake Petroules <jake.petroules@qt.io> Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
| | | * tst_QSocks5SocketEngine: Refactor testsFriedemann Kleint2017-01-231-88/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite tcpSocketNonBlockingTest() and downloadBigFile() to use lambdas for the slots. This allows for removing the related member variables and slots of the test class and ensures no leaks of sockets or inconsistent values. Add an error handler printing the error message to the flaky downloadBigFile() test. Change-Id: Ieb64063c41e045a1a50a6d074bef01753ee319ef Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * tst_QPauseAnimation: Use QTRY_COMPARE for checking the stopped stateFriedemann Kleint2017-01-201-39/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QTRY_COMPARE with a timeout to check for the stopped state unless BAD_TIMER_RESOLUTION is defined. This speeds up the test by 1s and prints diagnostic information should an interval be too short (as seems to be the case on macOS, currently). Change-Id: I8f884cd66ad33314124d3130d9f49606e6dfe9f3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| | | * Make shortcuts work for platform menu barsDmitry Shachnev2017-01-191-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a platform menu bar is used, the QMenuBar is hidden, so shortcuts for QActions attached only to it do not work. Extend the macOS-specific code to treat such menubars as visible to other platforms, to make the shortcuts work. The exception is made for internal QMenuBar shortcuts, which are forwarded to the platform menu. A follow-up change will add support for this to QDBusPlatformMenu. The updateGeometries() method is called for platform menu bars too to make sure the internal shortcuts are registered even if the global menu is in use. Add two cases to the tst_QMenuBar::activatedCount() test to test both native and non-native menu bars when possible (it now passes with native menu bars too). Change-Id: I2d7128512719ac199cd3f8f7ba28333d04d84ed4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | | * QSslDiffieHellmanParameters: simplify defaultParameters() constructionMikkel Krautz2017-01-181-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit simplifies defaultParameters() to simply construct an empty QSslDiffieHellmanParameters and assigning the DER-form of the DH parameters to QSslDiffieHellmanParametersPrivate's derData field. This creates a valid QSslDiffieHellmanParameters instance, but skips any potentially expensive verification steps. The previous implementation of defaultParameters() would use the public fromEncoded() method to construct an instance of the default parameters. This triggers a verification of the passed-in data, which can be expensive. To ensure our defaultParameters() QSslDiffieHellmanParameters instance does pass verification, this commit adds an autotest to verify that. Fixes QTBUG-57815. Change-Id: I6b1d9dbbfde526b232c319195ddbad42326be27c Task-number: QTBUG-57815 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Fix access incorrect index in QListView with batch layoutAleksei Ilin2017-01-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The size of flowPositions is larger by one than the number of rows in the model so the last correct row number is flowPositions.count()-2, not flowPositions.count()-1. Change-Id: Idf8bbd155151d553947d5d299dd01ffaff0c95fa Task-number: QTBUG-47694 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: David Faure <david.faure@kdab.com>
| | | * QHostAddress: add missing docsMarc Mutz2017-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qHash(QHostAddress) was added in Qt 5.0 (at least the version with uint seed = 0). op==(QHostAddress::SpecialAddress, QHostAddress) was there since QHostAddress was added before public history. Since QHostAddress does not have a \since, the I did not supply one for op==, either. Since the equality operator did not have unit-tests, added one. Change-Id: I954a0df02464338f08a12ca58d4cc0ceb013e67a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Plug memleaks in tst_QStackedLayoutMarc Mutz2017-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QLayout::replaceWidget() doesn't delete the affected item, but returns it. Change-Id: Ibda96e4bf2432ad13ed2908c7d37547f46e29a37 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | * Adapt to the C++ SIC introduced by P0021: noexcept overloadingThiago Macieira2017-01-144-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++17 adopts P0021R1[1], which makes noexcept be part of the function pointer's type and thus be overloadable. It contains some provisions for allowing a noexcept function pointer to cast implicitly to a non- noexcept function pointer, but that fails in the presence of templates and additional overloads that could match the type in question. Fortunately, the paper proposed a test macro, so we can change our sources now and be compatible with both C++14 and C++17 rules. This first failed with Clang 4.0 trunk. This source incompatibility is not our fault, it's the language's doing. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html Task-number: QTBUG-58054 Change-Id: I2bc52f3c7a574209b213fffd14988cf0b875be63 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * QFont: fix fromString(toString()) when application font has styleNameDavid Faure2017-01-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The style name needs to be cleared if not present in the string, otherwise the style name from qApp->font() (which propagates to any default-constructed QFont) remains. Change-Id: I9b6522a39a38526cced8a11ed02ae32582026480 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
| | | * tst_qfont: clear style name in test fontDavid Faure2017-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test failed if qApp->font() had a styleName() set, when testing old serialization formats which didn't serialize it. Change-Id: If0236d354be144b3a990e074a22f796fffb1ed18 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
| | | * tst_utf8: remove duplicate nonCharacters() dataMarc Mutz2017-01-101-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The population of data rows was factored into a separate file, qutf8data.cpp, in commit e20c4730. Merge commit 9bd03235 failed to track a conflicting change into the new file, and brought the code back into the tst_utf8.cpp, where it has been duplicating the utf8data data ever since. Change-Id: I4282685b882448f927289468bd7ab340a21ea0b3 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Fixed Chinese language selection on iOSJason Erb2017-01-101-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For language "Traditional Chinese" on iOS with region "US", the logic was formerly to attempt a match on country/language/script (fail), followed by country/language (which would result in script defaulting to "Simplified"). Now, the logic is to try language/script first if script is specified. Failing that, language/country will be attempted. Task-number: QTBUG-39639 Change-Id: I75a774b1e66686e95167ff221458a97a7ea2660d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jason Erb <jason.erb@sparist.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Drop unnecessary dependencies from some testsUlf Hermann2017-01-107-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The future tests don't need QtConcurrent as QFuture and friends are in QtCore. The printdevice test doesn't use QtNetwork and the lancelot as well as the testlib tests don't use QtXml. Change-Id: I150ac99b36682aa23ad22ba943266eb0f0952838 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | | * Fix compilation without sharedmemoryUlf Hermann2017-01-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to enable qt_safe_ftok with either sharedmemory or systemsemaphore. In order to make the resulting QT_CONFIG work with the bootstrap library we switch the features off for bootstrapping. Some tests and examples have to be excluded when sharedmemory is not available. Change-Id: I3fc3926d160202b378be2293fba40201a4bf50c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * QDateTime::fromString(): improve performance by 33%David Faure2017-01-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getMaximum() and getMinimum(), called during parsing, create new QDateTime instances, which on Linux end up calling mktime(). Making these static (for the common case of LocalTime spec) improves performance dramatically, when parsing several date/times. tests/benchmarks/corelib/tools/qdatetime/ (after fixing it to actually parse a valid date/time) says: RESULT : tst_QDateTime::fromString(): - 36,742,060 instruction reads per iteration (total: 36,742,060, iterations: 1) + 24,230,060 instruction reads per iteration (total: 24,230,060, iterations: 1) Change-Id: I0c3931285475bf19a5be8cba1486ed07cbf5e134 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Improve reliability of network bearer testsSimon Hausmann2017-01-023-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | May of the tests initiate a scan / update of the network configuration and expect the API to deliver exactly one update. This turns out to be a race condition as the update may be emitted multiple times, as QNetworkConfigurationManagerPrivate::updateConfigurations() is called via posted events (queued signal emissions) from the bearer thread, and so after creating the spy we may receive an update from _before_ and end up emitting the signal multiple times. Task-number: QTQAINFRA-1040 Change-Id: I931e2907f0cb86d48b4ab1a8795d75206035ea11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * QHeaderView: fix restoreState() on a model with more columnsDavid Faure2016-12-291-10/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When saving state for a 3-columns headerview and then restoring that state onto a 5-column headerview, the headerview shouldn't suddenly think it has 3 columns. Rather than making restoreState() fail, we adjust for the additional columns, so that we can still apply the customizations from the user to all other columns (hiding, moving, etc.). Change-Id: I3f220aa322ea8b629d2fe345f8cde13e0ea615d6 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | | * QIPM: Persist model indexes after emitting layoutChange, not beforeStephen Kelly2016-12-211-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callers can persist a QModelIndex which was not persisted before in a slot connected to the signal, and such a persisted index must be updated in the course of the layoutChange. Store the indexes to persist after emitting the signal. Task-number: QTBUG-32981 Change-Id: Ibee4c0d84817d72603a03fe5b22fdeefeac0695e Reviewed-by: David Faure <david.faure@kdab.com>
| | | * QSFPM: Remove data manipulation from move handlersStephen Kelly2016-12-211-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the fix in the parent commit, incorrect updating of the internal data structures during layout changes can lead to dangling pointers being dereferenced later. Moves are treated as layoutChanges by this proxy by forwarding to the appropriate method. However, data is incorrectly cleared prior to that forwarding. Remove that, and let the layoutChange handling take appropriate action. Change-Id: Iee951e37152328a4e6a5fb8e5385c32a2fe4c0bd Reviewed-by: David Faure <david.faure@kdab.com>
| | | * QSFPM: Fix handling of source model layout changeStephen Kelly2016-12-211-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In sourceLayoutAboutToBeChanged the source model update is ignored if the affected parents are filtered out anyway. The same logic is attempted in the sourceLayoutChanged slot, but there the early-return logic is applied too late - the mapping is cleared before performing the early-return. Because pointers into the mapping are used in the internalPointer of QModelIndexes in this class, persistent indexes used later will segfault when attempting to dereference it. Additionally, if a parent becomes invalid as a result of the layoutChange, it would be filtered out by the condition in the loop, resulting in a different result in the comparison of emptiness of the parents container. Fix that by persisting the parent's container, and performing the test for early-return before clearing the mapping. Task-number: QTBUG-47711 Task-number: QTBUG-32981 Change-Id: If45e8a1c97d39454160f52041bc9ae7e337dce97 Reviewed-by: David Faure <david.faure@kdab.com>