summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Avoid test failures in tst_qtimezone.cpp and Windows 10 1809Kai Koehne2019-01-281-2/+1
| | | | | | | | | | | The test started to fail now also for latest Windows 10 Update Restone 2. It's unclear why the test was succeeding before, since this seems a generic Windows API issue. Task-number: QTBUG-64985 Task-number: QTQAINFRA-2255 Change-Id: I804f6a61c63ea70157353d1aee9027d0735073ab Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QItemDelegate: try to stabilize combobox testChristian Ehrlicher2019-01-252-4/+1
| | | | | | | | | | | | | | | | tst_QItemDelegate::comboBox() is flaky because sometimes the used QTableWidget does not yet have the focus which prevents a correct editing. Fix it by explictily setting the focus on the widget after it is shown. A similar fix was added for dateTimeEditor() in 9822d57d858068cfe5a07281ef069ef8c4c7b7b3. With this patch the test no longer fails for my on opensuse, therefore remove the blacklisting. Task-number: QTBUG-67282 Change-Id: I907db662ca347f8e8d31e5be215a100377b159ca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* tst_qsslsocket - blacklist several test temporarilyTimur Pocheptsov2019-01-241-0/+6
| | | | | | | | | | | | | | | | | For some reason behavior of SecureTransport has changed from 10.12 to 10.13 and then to 10.14. On 10.13 SecureTransport fails upon receiving the server's certificate with 'Unrecoverable error', before we can do a manual verification and accept the certificate as trusted. Analysis of available source code shows that they, apparently, do not like MD5 hash which our server is using. Until certificate is updated on the server or we switch completely to the Docker-based solution we have to BLACKLIST tests that connect to our current network test-server. Oddly enough, on 10.14 SecureTransport is less mean. Task-number: QTBUG-69873 Change-Id: I7da1883e0970a2f6ddd8385f193b76116d6983e0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-2317-23/+101390
|\ | | | | | | Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
| * Stabilize tst_QItemDelegate::dateTimeEditor()Friedemann Kleint2019-01-221-10/+23
| | | | | | | | | | | | | | | | Add qWaitForWindowExposed() for the toplevel and use QTRY_VERIFY() for finding the delegates consistently. Change-Id: I430088a91b5cc1a8f856d0a58aba066b1baf179b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * tst_QString: fix localeAwareCompare() when using ICUChristian Ehrlicher2019-01-211-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tst_QString::localeAwareCompare() is failing since ab448f731ecd8437c7c5c8b96a0e7f419ec3a7ca because the 'C' locale no longer initializes ICU and falls back to simple QString comparison. Fix it by explicitly setting the locale for the testdata to en_US so the QCollator is properly initialized. Task-number: QTBUG-73116 Change-Id: I9d4d55e666c5c52f93298dedb7e22da01a25318d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9d2923c1b048b519c352c40bf26328dacef9304e) Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Use a more robust test for absolute paths in QDirEdward Welbourne2019-01-133-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its filePath() and absoluteFilePath() don't trust its own isAbsolute(), due to some infelicities on MS-Win; and kludged round a consequent problem with resource paths; but other virtual file systems weren't catered for. Replace the convoluted test there with a static bool function (so that future kludges in this area shall only need to edit one place; and can document why they're needed) and use a more robust test that handles all virtual file systems (by asking QFileInfo) but falls back to QFileSystemEntry to work round the known infelicities on MS-Win. Add regression test for asset library paths issue on iOS. Ammends 27f1f84c1c2. Moved a couple of local variables to after the early return, since it doesn't need them, in the process. Task-number: QTBUG-70237 Change-Id: Ib3954826df40ccf816beebe5c3751497e3bf6433 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-0816-398/+1308
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
| * | Drag'n'Drop: fix dnd when dragMoveEvent() is not implementedChristian Ehrlicher2019-01-071-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring of dnd with f8944a7f07112c85dc4f66848cabb490514cd28e added a regression which results in a need to reimplement dragMoveEvent() on the drop side. Before this change it was possible to accept the dnd in dragEnterEvent() without again accepting it in dragMoveEvent(). Fix it in a similar way it's done in QGuiApplicationPrivate::processDrag() by prefilling the first simulated QDragMoveEvent with the values from the previous QDragEnterEvent before it is sent to the drop receiver. Fixes: QTBUG-72844 Change-Id: I1300dd02b7f1d9dcd44ecefa8335f92ad6c6cafa Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * | Add binary compatibility files for 5.12 for QtBaseMilla Pohjanheimo2018-12-2111-0/+101252
| | | | | | | | | | | | | | | | | | | | | | | | Binary compatibility files added. Change-Id: I2543902fb7ac97270db7fb79ae09641898cc8ba4 Reviewed-by: Sergio Ahumada <sahumada@texla.cl> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Make url normalization closer to common browser behaviorJoni Poikelin2018-12-132-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firefox, Chrome and various http libraries normalize /./ and /../ from urls, but retain multiple adjacent slashes as is. Qt removes duplicated slashes which makes it impossible to access some web resources that rely on those. Fixes: QTBUG-71973 Change-Id: Ie18ae6ad3264acb252fcd87a754726a8c546e5ec Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix resolve() on fonts returned from QWidget::font()Allan Sandfeld Jensen2019-01-222-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the inherited properties as resolved on the font, so non-default values are passed on in contexts that does resolve logic like QPainter. One test is updated as it actually tests what it is supposed to on more configurations. Fixes: QTBUG-39560 Change-Id: Ief668e992ccdc091337a259a4c1306a00e67c73f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | tst_QGraphicsItem: stabilize cursor() testChristian Ehrlicher2019-01-221-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cursor test sometimes fails due to the fact that the topLevel widget has not yet reached it's fullscreen geometry. This means the QGraphicsView is to small and the test will fail. Avoid it by simply removing the topLevel widget since it's not used at all. Change-Id: Ia7b34f283a917a35b6665e6333a01378575a5a04 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Use RAII to handle setting of default locale in tst_QStringEdward Welbourne2019-01-221-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various tests were setting the default locale and relying on cleanup() to "restore" the C locale; which needn't actually be the locale we started out in and, in any case, was the wrong locale for some tests. So handle this via an RAII class that records the actual prior locale and restores it on destruction. Fixes: QTBUG-73116 Change-Id: If44f7cb8c6e0ce81be396ac1ea8bab7038a86729 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | tst_QPrinter: stabilize qprinter testChristian Ehrlicher2019-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CreationDate entry in the two PDF files can potentially be different depending on when the test is run. 97b4c5a5746a33a27076d72ceb3533fbd54b9642 already accounts for it but the current tag for creation date is '/CreationDate'. Therefore check if the line contains 'CreationDate' instead. Change-Id: I1fc069cf935bba07084ac4a0743ff05312374d10 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | tst_QString: fix localeAwareCompare() when using ICUChristian Ehrlicher2019-01-201-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tst_QString::localeAwareCompare() is failing since ab448f731ecd8437c7c5c8b96a0e7f419ec3a7ca because the 'C' locale no longer initializes ICU and falls back to simple QString comparison. Fix it by explicitly setting the locale for the testdata to en_US so the QCollator is properly initialized. Task-number: QTBUG-73116 Change-Id: I9d4d55e666c5c52f93298dedb7e22da01a25318d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Eliminate some stray misleading paths from expected output filesEdward Welbourne2019-01-165-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | The output files for the tuplediagnostics selftest of testlib had a stray non-canoical path fragment in them; so replaced with its canonical form. Change-Id: Ib421380036c3fb1b91447eb8c87be4ad0dfe5c96 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | tst_qsyntaxhighlighter: fix no-op QTRY_VERIFY checkMårten Nordheim2019-01-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The bool is assigned on the previous line: QTRY_VERIFY will not do anything because the statement is already true. Change-Id: I067290e19ffd100819b2b631af431c6013623a00 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | QSyntaxHighlighter: cancel delayed highlight if done manuallyMårten Nordheim2019-01-161-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was an implicit effect before which stopped working after dec7961709c90f6977d2447f7fa6c6625af41cb2. Reintroduce it as some projects used this side-effect as a way to abort the initial highlighting. Change-Id: I5340ee9882a242bc8b5f7f843f1cfe793a65d357 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | fix out-of-bounds access on trailing percent sign in tr() argumentOswald Buddenhagen2019-01-142-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tr() recognizes %n and %Ln. it offers no way to escape lone percent signs, which implies that they must be interpreted verbatim, which is what the code actually does. except that it would run off the end if the % appeared at the end of the string. Fixes: QTBUG-57171 Done-with: Mateusz Starzycki <mstarzycki@gmail.com> Change-Id: Icf81925c482be1ea66ec8daafb3e92ad17ea7fab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* | | qWaitFor: Prevent being stuck in QCoreApplication::processEventsTor Arne Vestbø2019-01-098-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the overload of QCoreApplication::processEvents that takes a maxtime argument, the function will keep processing events until there are no more events, or until it times out. The problem is that the function doesn't distinguish between events that were on the event queue when the function was called, and events generated by processing events as part of its own execution. If for example a widget calls update() in its paintEvent, the function will spin for the entire duration of maxtime. That doesn't work for qWaitFor, where we need to check the predicate between each pass, so we use the overload of processEvents that doesn't take a maxtime. That's fine, as we have our own timeout logic. Change-Id: I9738d7d0187c36d4a5ddfcd3fd075b0bd84583c4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Blacklist a flaky qtableview function in WinRTTony Sarajärvi2019-01-081-0/+2
| |/ |/| | | | | | | | | Task-number: QTBUG-72853 Change-Id: Iaf2b25712b571a3ce73387cb3d2e70d427808364 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Fix warnings about uninitialized variablesJędrzej Nowacki2019-01-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/kernel/qmetatype.cpp: In static member function ‘static void QMetaType::destroy(int, void*)’: qtbase/src/corelib/kernel/qmetatype.cpp:2599:27: error: ‘info.QMetaType::m_destructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (m_typedDestructor && !m_destructor) ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_destructor’ was declared here QMetaType info(type); ^~~~ qtbase/src/corelib/kernel/qmetatype.cpp:2600:26: error: ‘info.QMetaType::m_typedDestructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] m_typedDestructor(m_typeId, data); ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_typedDestructor’ was declared here QMetaType info(type); ^~~~ The extended (not inlined) function may be called on a half initialized invalid instance. Change-Id: I26d677a8ad2bd0c5846233f06393e774d377936d Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | qmake: add $$read_registry() functionOswald Buddenhagen2019-01-051-0/+2
| | | | | | | | | | Change-Id: I7f9f17e0f44c273e4754d1decc92a8594cad8658 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Revert "Blacklist tst_QTimer::basic_chrono on macOS"Tony Sarajärvi2019-01-041-2/+0
| | | | | | | | | | | | | | | | | | | | Incorrectly blacklisted. This reverts commit 40a7c57ba990dfd58814a4a9dc69948991458cd4. Task-number: QTBUG-61013 Change-Id: I7d9dc4a4b1c8d7ff77ab75c61027b908ffb74552 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Remove dead codeVitaly Fanaskov2019-01-041-134/+0
| | | | | | | | | | | | | | Task-number: QTBUG-44131 Change-Id: Ic092f2be5855840d6467560159c12f3c5aa36344 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Respect roles of buttons added to QMessageBoxVitaly Fanaskov2019-01-031-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a button added to QMessageBox has AcceptRole or YesRole, the signal accepted() will be emitted upon click on the button. If the button has RejectRole or NoRole, the signal rejected() will be emitted upon click on the button. If a button has a different role, neither accepted() nor rejected() will be emitted. This works for both standard and custom buttons. The signal finished() with result code will be sent regardless of a clicked button role. Also added documentation strings for some methods of private classes in order to have better tooltips in IDE(s). Task-number: QTBUG-44131 Change-Id: I521a4e5112eb4cf168f6fbb4c002dbe119aeeb09 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Fix QStringListModel::setData to check for actual changesLuca Beldi2018-12-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QStringListModel::setData documentation states that "The dataChanged() signal is emitted if the item is changed." This patch actually respects the doc. setData will check that the data actually changed before sending the dataChanged signal. [ChangeLog][QtCore][QStringListModel] setData will now emit the dataChanged() signal only if the string set is different from the one already contained in the model Change-Id: I4308a6f3b4851203fb899c5e29a36076e0c32f2f Reviewed-by: David Faure <david.faure@kdab.com>
* | macOS: Only do gamma-corrected blending for subpixel-antialiased textTor Arne Vestbø2018-12-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The grayscale font-smoothing doesn't expect to be linearly blended, as first assumed. Amended nativetext manual test to better diagnose the native Core Text behavior. Non-linear blending will result in the magenta text having a dark outline against the green background. Change-Id: I24a5f04eb1bd66fb98d621078d80ee9b80800827 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Fix text shifting vertically when elidedEskil Abrahamsen Blomfeldt2018-12-212-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When eliding text we would check for the existence of the ellipsis character and fall back to using the dot if it was not available. However, when font merging was in use, we would also use ellipsis from a fallback font if available. This could cause the metrics of the text to increase if the fallback font had larger metrics, and the result was that text could shift when elided. It is better to prefer the dot from the current font than to use the ellipsis from a fallback, so we only use the ellipsis if it is in the main font. [ChangeLog][QtGui][Text] Fixed a bug where eliding text could change the height of its bounding rectangle for certain fonts. Fixes: QTBUG-72553 Change-Id: Ib27fc65302465ddce661801bcc5ae32e55f1aeb9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QTableView: Fix keyboard navigation with disabled rowsChristian Ehrlicher2018-12-181-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The keyboard navigation with MovePageUp/Down and MoveEnd did not honor disabled cells in all cases which lead to inconsistencies in the navigation (esp. since MoveHome does honor them correctly). Therefore make sure that all four move operations work consistent by refactoring the code to use common functions. Fixes: QTBUG-72400 Change-Id: I63fa3b626510d21c66f4f9b2b1bfb3261728ecaf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | nativewindow: Add additional test for 8pt font sizeTor Arne Vestbø2018-12-161-4/+3
| | | | | | | | | | | | Change-Id: I5012eb6ffee8f81da61a6fe611352ee5900a5eee Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | moc: add support for C++11 enum structSamuel Gaist2018-12-152-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++11 added the new enum class key as well as enum struct. While the former is likely the most known and used, the later can be used in the same contexts and with the same effects. Currently moc doesn't parse enum struct while it does for enum class. This patch fixes this. [ChangeLog][moc] moc now parses enum struct the same way as enum class therefore that keyword can be used with the Q_ENUM macro as well as Q_FLAG and Q_DECLARE_FLAGS. Change-Id: Iaac3814ad63a15ee4d91b281d451e786b510449c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QRegularExpression: anchor wildcard patternSamuel Gaist2018-12-151-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of wildcardToRegularExpression doesn't anchor the pattern which makes it not narrow enough for globbing patterns. This patch fixes that by applying anchoredPattern before returning the wildcard pattern. [ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression method now returns a properly anchored pattern. Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5 Fixes: QTBUG-72539 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | 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>
* | 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 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>
* 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>
* 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>