summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-151-163/+966
|\ | | | | | | Change-Id: Iad06d8c07dfc288c9d1a9f7ee3520285cea60546
| * QAbstractSlider: fix invertedControls having no effect for left/right keysMitch Curtis2018-12-131-3/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a comment in the code that said: // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird. It's not clear what that was referring to, but in its current state, a slider with invertedControls set to true will not behave as expected: pressing the left arrow key will decrease its value instead of increasing it, and vice versa for the right arrow key. As stated in the documentation (and by its name), invertedAppearance only controls the appearance of the slider, and not the effect of key events. Remove the comment and use invertedControls instead. Change-Id: I13296cbda9244413978ef0d7f0856065f74fd0bf Fixes: QTBUG-25988 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Refactor tst_QAbstractSlider::keyPressed()Mitch Curtis2018-12-131-163/+482
| | | | | | | | | | | | | | | | | | | | Don't do several tests at once in the test function. Instead, move the extra tests to the data function. This makes it possible to easily add a self-contained test (i.e row) for an upcoming fix. Task-number: QTBUG-25988 Change-Id: I65c8d7620f01107f8f59c96896b1a641d97f5fdc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | OpenSSL: drop support for SSLv2 and SSLv3Giuseppe D'Angelo2018-12-131-129/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per RFC 6176 (2011) and RFC 7568 (2015). Code-wise, we're left with the decision of what to do with a few enumerators in QSsl::Protocol; I've made TlsV1SslV3 act as TlsV1, and adjusted the description of AnyProtocol. A new test was introduced - deprecatedProtocol() - to test that we, indeed, do not allow use of SSL v2 and v3. protocol() and protocolServerSide() were reduced to exclude the (now) no-op and meaningless tests - neither client nor server side can start a handshake now, since we bail out early in initSslContext(). [ChangeLog][QtNetwork][SSL] Support for SSLv2 and SSLv3 sockets has been dropped, as per RFC 6176 (2011) and RFC 7568 (2015). Change-Id: I2fe4e8c3e82adf7aa10d4bdc9e3f7b8c299f77b6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | uic: No longer generate static_cast for enum values in legacy formsFriedemann Kleint2018-12-1313-25/+25
| | | | | | | | | | | | | | | | | | Add a lookup for the affected enum values and use the names instead. Task-number: PYSIDE-797 Change-Id: I6be166409000aff83d9465c9a3b2f37b44c5c085 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.12' into dev" into ↵Qt Forward Merge Bot2018-12-135-50/+98
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-135-50/+98
| |\| | | | | | | | | | Change-Id: I0fe623517af28e408b642c879efd59f633ab63ac
| | * qt_imageFromWinHBITMAP(): Fix memory corruption when converting from bitmaps ↵Friedemann Kleint2018-12-121-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with low depths Insufficient memory was allocated when asking GetDIBits() to convert to 32bit. Fix allocation size and use a QScopedArrayPointer. Fixes: QTBUG-72343 Change-Id: I45f79c913a243316e01bc6efed08e50ccc7d25f4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| | * tst_QMessageBox: Modernize and simplify codeVitaly Fanaskov2018-12-121-37/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed 0 to nullptr, used more C++-style casts, simplified some code for searching a button, and changed foreach to range-based for loop. Task-number: QTBUG-44131 Change-Id: I211b12751b0e2591d1d14294c31b51d52bb4e3f6 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| | * nativetext: Fix baseline positioning for CoreTextTor Arne Vestbø2018-12-111-8/+19
| | | | | | | | | | | | | | | | | | | | | The Qt and CoreText positioning is now in sync. Change-Id: I0cbb5b150d1bef732674b8d42c64a040773a62ab Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Handle QCollator with locale C by delegating to QStringEdward Welbourne2018-12-111-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the C locale was treated as English because each back-end takes the locale's bcp47Name(), which maps C to en. However, the C locale has its own rules; which QString helpfully implements; so we can delegate to it in this case. Extended this to sort keys, where possible. Clean up existing implementations in the process. Extended tst_QCollator::compare() with some cases to check this. That required wrapping the test's calls to collator.compare() in a sign canonicalizer, since it can return any -ve for < or +ve for >, not just -1 and +1 for these cases (and it'd be rash to hard-code specific negative and positive values, as they may vary between backends). [ChangeLog][QtCore][QCollator] Added support for collation in the C locale, albeit this is only well-defined for ASCII. Collation sort keys remain unsupported on Darwin. Fixes: QTBUG-58621 Change-Id: I327010d90f09bd1b1816f5590cb124e3d423e61d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Avoid crash in blitting or fast draw when QPointF is too bigAllan Sandfeld Jensen2018-12-111-0/+16
| | | | | | | | | | | | | | | | | | | | | Change-Id: I88182d5d95fda15d33836f16dee78167685b3765 Fixes: QTBUG-72392 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | | Add Grayscale16 Image FormatAllan Sandfeld Jensen2018-12-123-13/+37
|/ / | | | | | | | | | | | | | | | | | | [ChangeLog][QtGui][QImage] Added support for 16-bit grayscale format. Together-with: Aaron Linville<aaron@linville.org> Task-number: QTBUG-41176 Change-Id: I5fe4f54a55ebe1413aa71b882c19627fe22362ac Reviewed-by: Nick D'Ademo <nickdademo@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Resources: reject compressed content we can't decompressThiago Macieira2018-12-125-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solution is composed of two features: 1) C++ code generated by RCC uses two symbols exported from QtCore that are only present if the feature was compiled in. If the feature was not compiled in, this will cause a linker error either at build time or at load time (if they were functions, the error could be at runtime). 2) Binary files generated by RCC have a new header field containing flags. We're currently using two flags, one for Zlib and one for Zstandard. This means we now have binary RCC format version 3. Change-Id: I42a48bd64ccc41aebf84fffd156545fb6a4f72d9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Revert "Disable Docker-based test servers on Linux temporarily"Ryan Chu2018-12-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4b1ce72c232b21fb1a8ae8ca86c2b8a7bc00b993. The required SHA-1 updates were integrated as: qt/qt5 ce3791a214f69b6f0310bfe1d5bcc12ac6927c49 qt/qtbase 75ee55e22a49327193aade21bf615efc7c879564 Change-Id: Ic389128ea9b507c506b18a47090930329a4ff6a2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | QTreeWidget: mark is/setFirstItemColumnSpanned() as deprecatedChristian Ehrlicher2018-12-111-0/+23
| | | | | | | | | | | | | | | | | | | | | | Deprecate the QTreeWidget functions is/setFirstItemColumnSpanned() to stay in sync with the other deprecated functions (selected/expanded/hidden) so they can get removed in Qt6. Also add a small unit test for them. Change-Id: Ie1cb5d7163c2d56d653c21e841ccaf7d38569787 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Docker Provisioning: Update the SHA-1 tag of server imagesRyan Chu2018-12-102-10/+10
| | | | | | | | | | | | | | | | | | This update is used to free the dependencies of the specific Ubuntu packages. It ensures that test server is using the latest version of the Ubuntu packages to test network changes. Change-Id: I3257f435e6da02e3c6d5a141ece9c5d025e13065 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Use QScopedPointer instead of new/deleteJesus Fernandez2018-12-101-7/+7
| | | | | | | | | | | | | | Change-Id: I0651ad0244c1b4d3126a1dd3304f247f92240ffa Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QTypeInfo: use C++11 type traits to deduce if a type is static or complexLars Knoll2018-12-102-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All types that can be trivially copied and destructed are by definition relocatable, and we should apply those semantics when moving them in memory. Types that are trivial, are by definition not complex and should be treated as such. [ChangeLog][QtCore] Qt Containers and meta type system now use C++11 type traits (std::is_trivial, std::is_trivially_copyable and std::is_trivially_destructible) to detect the class of a type not explicitly set by Q_DECLARE_TYPEINFO. (Q_DECLARE_TYPEINFO is still needed for QList.) Done-with: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Change-Id: Iebb87ece425ea919e86169d06cd509c54a074282 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QUrlQuery: Implement initializer list constructorSamuel Gaist2018-12-091-0/+8
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QUrlQuery] QUrlQuery now provides an initializer list constructor. It can be created using a list of key/value pairs. Fixes: QTBUG-68645 Change-Id: Ief5939aa477718f6dd3580f2c60f95ff3aa892ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-094-3/+355
|\| | | | | | | Change-Id: I10ae61ec6867b38601d85d6fc34e1f6a6ba0cc11
| * Add manual test case for verifying our text renderingTor Arne Vestbø2018-12-083-1/+319
| | | | | | | | | | | | | | | | Allows comparing Qt's text rendering to the native rendering. Change-Id: I56f015fb64df3f70c33db58891876c325cbbc55d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Set QScroller's parent to its widget, for memory managementShawn Rutledge2018-12-081-2/+36
| | | | | | | | | | | | | | | | | | | | | | If the widget to which the scroller was assigned is deleted, the QScroller ought to be deleted too, to avoid filtering events and then following a dangling pointer while trying to react. Fixes: QTBUG-71232 Change-Id: I62680df8d84fb630df1bd8c482df099989457542 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-084-6/+50
|\| | | | | | | Change-Id: Ied1194730e75a6f30839bbf5429aa2699230288e
| * Fix QSettings parsing of spaces after comment linesThiago Macieira2018-12-073-0/+49
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QSettings] Fixed QSettings parsing of blank spaces after comment lines in INI-style configuration files. Fixes: QTBUG-72007 Change-Id: Idd0c85a4e7b64f9c9c7dfffd156c5b219f3b5c0a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Remove one out-of-date comment, refine another that was impreciseEdward Welbourne2018-12-071-6/+1
| | | | | | | | | | | | | | The former is a follow-up to c17563eca8. Change-Id: I3cd41e6e38f740de67605f785a804ffd879b9e67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add a testlib selftest for the watchdogEdward Welbourne2018-12-0611-4/+165
| | | | | | | | | | | | | | | | Verify that it does cut in after the specified time has elapsed. Task-number: QTPM-1385 Change-Id: Ib18e8d6af28339f79cca4d62b869287ce07b8cc1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | generate_expected_output.py: refine environment used for subtestsEdward Welbourne2018-12-061-26/+64
| | | | | | | | | | | | | | | | | | Match the environment tst_selftests.cpp uses for subtests more faithfully. Extends b22e50acda. In the process, tweak how crashers are handling, in preparation for the watchdog test. Change-Id: I09a046460f6f3bff0b12069fad6c1437d89572ce Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Test that mismatches of datatype in test data columns are rejectedEdward Welbourne2018-12-0621-10/+347
| | | | | | | | | | | | | | | | | | | | One test for bad data for the column, another for a bad QFETCH. Incidentally extend blacklist testing by blacklisting them. Reorganise a QEMU condition that needed extended as part of this. Task-number: QTPM-1385 Change-Id: Iac72ada19760321c5c9264ddfff7740d1fdd0700 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | QMdiArea: Do not move active subwindow after tile rearrangeNick D'Ademo2018-12-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | Currently, a tile rearrange will move the active subwindow (if any) to position zero (top-left). This ignores any tiling order set via setActivationOrder(). This change removes this move so that the set tiling order is respected when a tile operation is performed. Fixes: QTBUG-43356 Change-Id: I2c481f0ffe45e42e811c6b6d476eb4cb65aa5d1f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Add tst_QOcsp auto-testTimur Pocheptsov2018-12-0611-0/+1074
| | | | | | | | | | | | | | | | | | This patch introduces a private 'API' to enable server-side OCSP responses and implements a simple OCSP responder, tests OCSP status on a client side (the test is pretty basic, but for now should suffice). Change-Id: I4c6cacd4a1b949dd0ef5e6b59322fb0967d02120 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QListWidget: mark (is|set)Item(Selected|Hidden) as deprecatedChristian Ehrlicher2018-12-041-12/+14
| | | | | | | | | | | | | | | | | | | | | | QListWidget::(is|set)Item(Selected|Hidden)() are deprecated for a long time but not marked as such. Therefore explicitly mark them as deprecated so they can get removed with Qt6. Change-Id: I4567e740f1ebb5841b2e5b50c601fb83a782950c Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.12' into dev" into ↵Liang Qi2018-12-0431-99/+391
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-0431-99/+391
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
| | * Fix compilationLars Knoll2018-12-031-0/+1
| | | | | | | | | | | | | | | | | | | | | ::link() is defined in unistd.h, so include it. Change-Id: I58e99dbcdd64da6388f85d98e73e7d1bd56f4e37 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| | * Add lancelot tests to verify vertical alignment of inline imagesLars Knoll2018-12-033-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | Adds a test case for 199f9c54484b0dae3bc81f83c880a965192ecb24. Task-number: QTBUG-59310 Change-Id: Iee26f8bc21884da36471935f64524b62c3f79ff4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| | * Read font selection flags and use them when querying for metricsMårten Nordheim2018-11-303-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain fonts with multiple styles have the same family name. When loading these as application fonts we were not specific enough when querying for the text metrics. This meant that e.g. the bold version in a font family would get the metrics of the regular one. Fixes: QTBUG-67273 Change-Id: Ic988d62cddde0a1f77ddcaf2891cadc21c9b31e6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Fix a nullptr compile error with gcc 4.8Ville Voutilainen2018-11-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | template argument deduction/substitution failed: qtbase/tests/auto/corelib/kernel/qobject/tst_qobject.cpp:6756:71: note: mismatched types ‘const typename QtPrivate::FunctionPointer<Func2>::Object*’ and ‘std::nullptr_t’ Change-Id: I8e7872457d1fc30c4b29e96c16091915264f9bce Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Avoid invalid qmake code in macOS-specific pluginloader testUlf Hermann2018-11-306-61/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You cannot manipulate variables in custom target dependencies, so the following code was invalid: i386_d.depends = EXPORT_VALID_ARCHS=i386 In order to still build the fat binary, we split the project in four, one for each architecture, plus one to create the final package. Change-Id: If08cf54e2e4098a7e10df41b7ea8d2bf699f58be Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * QFocusFrame: protect it from being moved around by accidentRichard Moe Gustavsen2018-11-271-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a focus frame is set around a widget that exist inside a QAbstractItemView, both the focus frame and the widget will be scrolled when the table is scrolled (since the focus frame is a child of the view). The result is that after the widget has been scrolled (which will move the focus frame to the correct position as well), the focus frame will be scrolled next, and therefore away from the widget. This patch will catch this case by always adjusting the focus frame position when someone tries to move it. Trying to move the focus frame away from the widget it tracks will anyway be flaky. Fixes: QTBUG-63877 Change-Id: Ic2aacc4fafc219280e32092c258a7539d0db9cd0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * Re-enable the QScroller tests on macOSShawn Rutledge2018-11-271-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Maybe they aren't flaky anymore... let's find out. Task-number: QTBUG-29950 Task-number: QTBUG-30133 Change-Id: I1a2a3ef7facac5b6e59588d7c6b1b28b40a788ea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Fix tst_QStyleSheetStyle crash on uncommon multi-screen setupAllan Sandfeld Jensen2018-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | It would crash if there is no screen at 0,0. Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-11-2714-24/+197
| | |\ | | | | | | | | | | | | Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
| | | * Make developer build tests pass for boot2qtSami Nurmenniemi2018-11-2613-6/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests were fixed and others were skipped/blacklisted. Task-number: QTBUG-63152 Change-Id: Ica7df555f8d152ee589865911130525101d4b941 Reviewed-by: Liang Qi <liang.qi@qt.io>
| | | * Recognize E along with e as exponent character in asciiToDoubleEdward Welbourne2018-11-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a misguided condition in the check for bogus texts in the sscanf branch of the decoder; it checked for 'e' but neglected 'E', which is just as valid. Change-Id: I9236c76faea000c92df641930e401bce445e06c8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * Fix toFloat()s between float and double ranges and documentEdward Welbourne2018-11-231-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revised some toFloat()s to be consistent with the matching toDouble()s; previously, they would return infinity if toDouble() did but return 0 if toDouble() got a finite value outside float's range. That also applied to values that underflowed float's range, succeeding and returning 0 as long as they were within double's range but failing if toDouble() underflowed. Now float-underflow also fails. Amended their documentation to reflect this more consistent reality. Added some tests of out-of-range values, infinities and NaNs. [ChangeLog][QtCore][toFloat] QString, QByteArray and QLocale returned an infinity on double-overflow (since 5.7) but returned 0 on a finite double outside float's range, while setting ok to false; this was at odds with their documented behavior of returning 0 on any failure. They also succeeded, returning zero, on underflow of float's range, unless double underflowed, where they failed. Changed the handling of values outside float's range to match that of values outside double's range: fail, returning an infinity on overflow or zero on underflow. The documentation now reflects the revised behavior, which matches toDouble(). Change-Id: Ia168bcacf7def0df924840d45d8edc5f850449d6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * Change documentation of some toDouble()s to reflect realityEdward Welbourne2018-11-231-12/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They actually return infinity if conversion overflows, while still setting ok to false; they were documented to return 0 on failure, with no mention of this special handling of overflow. Documented reality rather than changing the behavior. Gave underflow as an example of failure other than overflow (toDouble()s do indeed fail on it). Added some tests of out-of-range values, infinities and NaNs. [ChangeLog][QtCore][toDouble] QString, QByteArray and QLocale return an infinity on overflow (since 5.7), while setting ok to false; this was at odds with their documented behavior of returning 0 on failure. The documentation now reflects the actual behavior. Fixes: QTBUG-71256 Change-Id: I8d7e80ba1f06091cf0f1480c341553381103703b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * tst_QLocale: Add tests for toFloat()Edward Welbourne2018-11-231-1/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Mirror those for toDouble(). Change-Id: Ide0ef3cd99528d575f6a578ef19547f3b1119c5d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * Implement transient locale as instantiating a classEdward Welbourne2018-11-231-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of QLocale tests were using setlocale twice to provide a transient locale tweak in tests; however, if the test in between fails, that can leave the program running in the "transient" locale after. So implement a proper class whose destructor ensures the transient is tidied away. Also change the locale in use by one of these transient changes: it purported to be checking things didn't depend on locale, but was using the same local as most of the test-cases for its test. Change-Id: I0d954edcc96019a8c2eb12b7a7c568e8b87a41d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | QMdiArea: Take scroll bars into account when tiling subwindowsNick D'Ademo2018-12-041-4/+11
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMdiAreaPrivate::resizeToMinimumTileSize() does not take into account scroll bars when calculating the minimum size for the QMdiArea widget. As a result, if scroll bars are enabled or showing during a tiling operation, the top-level widget incorrectly expands in size (instead of utilizing the scroll bars). Therefore, we should only resize the top-level widget if scroll bars are disabled. Fixes: QTBUG-40821 Change-Id: I3a8b7582d23fdf12d2b09f3740eea6b60bb395c3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>