Commit Graph

9205 Commits

Author SHA1 Message Date
Alexander Volkov
685b8db13a Forward devicePixelRatio in QPixmap::mask()
Also add a test checking that devicePixelRatio is forwarded to
derivatives of QPixmap.

Change-Id: Idb2b3f033ccc0fd49bf54b11f5dffbce5a19b006
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 15:21:18 +00:00
Edward Welbourne
954b73445c Refine underflow check in QLocaleData::convertDoubleToFloat()
A string can parse as a non-zero double that's smaller than the
smallest float yet be a faithful representation of the smallest float.
So rather than testing for non-zero doubles less than the smallest
float, test for non-zero doubles that cast to float zero; these
underflow.  This means small values close below the smallest float
shall round up to it, rather than down to zero, requiring a tweak to
an existing test.  Added a test for the boundary case (and tidied the
test data).

Fixes: QTBUG-74833
Change-Id: I4cb30b3c0e54683574b98253505607caaf88fbfb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 14:40:14 +00:00
Eirik Aavitsland
3b7db8ac90 Fix assert/crash when creating QBrush with null QGradient
The QBrush constructor taking a QGradient would assert or crash if
passed a null (NoGradient) gradient. But it is not necessary for the
API to be as brittle as that: instead the result can simply be a null
QBrush object, i.e. the same as the default QBrush() constructor
creates (style == NoBrush).

This issue comes up now since with the recent introduction of
QGradient presets, the API opens for using QGradient directly, whereas
earlier, only the subclasses QLinearGradient etc. were to be used.

Fixes: QTBUG-74648
Change-Id: I1a9b1c4654e4375aa6684700a262cc0946851448
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-04-01 11:56:42 +00:00
Joerg Bornemann
9e97d64ccd Fix installation of .pdb files for applications that have VERSION set
For applications that set VERSION the installation targets of pdb
files were wrong in qmake's nmake Makefile generator.

Replace code that tries to reconstruct that target's versioned
extension with TARGET_EXT which already contains the fully resolved
target extension.

Fixes: QTBUG-74265
Change-Id: I9553a5f70170e077a59c866079ae51647ae80bef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-03-31 12:45:24 +00:00
Volker Hilsheimer
743e883c12 Blacklist the reverse lookup of 8.8.8.8 to unblock integrations
The DNS entry for the host has changed, dig answers with dns.google,
not with google-public-dns-a.google.com. While developing a proper
fix to the test, blacklisting this particular lookup allows
integrations to pass in the meantime.

Change-Id: Id37da6b24554803bf4e2c84be5b949ded40566e8
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-29 13:45:47 +00:00
Kai Koehne
54efa7e592 Blacklist qgraphicsitem::sorting test on opensuse-42.3
Task-number: QTBUG-74760
Change-Id: I79bd58e6be61c59e0f1fa48dba0dee72e0a7e78c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-03-29 07:36:48 +00:00
Joerg Bornemann
63156e2062 tst_qmake: Add XFAILing test
Task-number: QTBUG-74265
Change-Id: I916eaf7b64a8777bf2523ddf9da65226d7d06417
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-03-26 06:28:18 +00:00
Mårten Nordheim
9e61cec791 Network cache: Stop treating no-cache like no-store
In the QNetworkAccessManager machinery we would treat "no-cache" as if
it meant "don't cache" while in reality it means "don't return these
cached elements without making sure they're up-to-date"

At the same time as this change is made let's add test data for
"no-store", which replaces the "no-cache" test data.

Fixes: QTBUG-71896
Change-Id: Ieda98f3982884ccc839cac2420c777968c786f6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2019-03-22 13:25:54 +00:00
Albert Astals Cid
85a9009f25 QPixmap: More safe failing if qApp is not a QGuiApplication
It can happen that QDataStream is fed a QVariant that contains a QPixmap
representation, that will make the application crash when trying to
restore it

This is specially important for cases in which applications expose dbus
interfaces with QVariantMaps

Change-Id: Ife4feaef30f30e7e27d88464bd6b2a247f743123
Reported-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-22 08:06:43 +00:00
Friedemann Kleint
b01248ebbd Fix tree recursion in QAbstractItemModel::match()
Recurse down the sibling at column 0 of the index instead down the
index.

Change-Id: Ie78d8b28eab7438ca3f83ee0df177115ca82806e
Fixes: QTBUG-73864
Reviewed-by: David Faure <david.faure@kdab.com>
2019-03-22 08:01:35 +00:00
Edward Welbourne
03fadc26e7 Fix broken data for time-zones with no transitions
While an invalid time-zone shall have no transitions, so may various
constant zones, like UTC.  The TZ data may include only the POSIX rule
for such a zone, in which case we should use it, even if there are no
transitions.

Broke out a piece of repeated code as a common method, in the process,
since I was complicating it further.

Added test for the case that revealed this; and made sure we see a
warning if any of the checkOffset() tests gets skipped because its
zone is unsupported.

Fixes: QTBUG-74614
Change-Id: Ic8e039a2a9b3f4e0f567585682a94f4b494b558d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-22 07:32:52 +00:00
Friedemann Kleint
0211774c68 Silence QMainWindow test
Set object names on the widgets in restoreState(), fixing:
QWARN  : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x7ffcb45e5e00 ';
QWARN  : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QToolBar 0x7ffcb45e5dd0 ''
QWARN  : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x7ffcb45e5e00 ';
QWARN  : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QToolBar 0x7ffcb45e5dd0 ''

Task-number: QTBUG-74242
Change-Id: I19f19e93de9df00d001b820a31836ce0b3cd2877
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-03-22 07:27:11 +00:00
Friedemann Kleint
c45f2eab85 Silence the item model tests
Introduce a logging category for the qDebug()-output.

Add a meta type registration for QList<QPersistentModelIndex>, fixing
numerous warnings like:
WARN  : tst_QItemModel::remove(QStandardItemModel:invalid start, valid count 5) QSignalSpy: Unable to handle parameter 'parents' of type 'QList<QPersistentModelIndex>' of method 'layoutChanged', use qRegisterMetaType to register it.

Fix a Clang warning about potential misuse of operator ,

Task-number: QTBUG-73864
Change-Id: I60998403a44f5df8767926951ee13d1ed1e93c37
Reviewed-by: David Faure <david.faure@kdab.com>
2019-03-21 13:39:01 +00:00
Joerg Bornemann
2abd969ef6 tst_qmake: Keep the source dir clean
Copy the test data into a temporary directory and do all the work there
without tainting the source directory. More importantly, do not pull in
any settings from the Qt build to test what actual users will encounter.

Change-Id: I793b86bfadb7597efb47c8f2d3fc863384c78a79
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-03-20 08:39:55 +00:00
Jesus Fernandez
adaa3acc74 Use Q_UNUSED(updateRect) when building without QT_BUILD_INTERNAL
Change-Id: I3e5292bc09ae53bee5f8bb8c7c1922d1a20b2e10
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-03-18 10:38:50 +00:00
Friedemann Kleint
50f3f8f6bb Use High DPI pixmaps in prominent examples and tests
Set AA_UseHighDpiPixmaps.

Task-number: QTBUG-52622
Change-Id: Ic4373a9c94952f50bc1ad36bcc0dec850efc124a
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-03-15 18:26:56 +00:00
Qt Forward Merge Bot
a1808c5dbe Merge remote-tracking branch 'origin/5.12.2' into 5.12
Change-Id: I5f9d8090a07056411fb65d7de60eb679d00e99a3
2019-03-15 11:10:10 +01:00
Kai Koehne
097bf6fdd2 Fix compilation of qCDebug("", ...) with QT_NO_DEBUG_OUTPUT
... and fix QT_NO_INFO_OUTPUT, QT_NO_WARNING_OUTPUT alongside.

Fixes: QTBUG-74359
Change-Id: I2167dc943ae8c52602e08e24ca815d95f82a5db8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-14 17:15:53 +00:00
Tony Sarajärvi
912bcf0f0d Expand blacklisting of tst_qsslkey to cover all versions of RHELs
Previous blacklisting 5c4e5032b5 only
covered RHEL 6.6 and RHEL 7.4. The problem however exists in all
6.x and 7.x distros as they have the same openssl.

This however leaves us the problem with future RHEL 8. This will
keep blacklisting these tests there as well. We need a way to blacklist
versions with a wildcard so that we could say RHEL-7.*

Task-number: QTBUG-46203
Change-Id: I2cc52ba2eac949214ecaa02e19d9e623d5befc49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-10 14:08:21 +00:00
Edward Welbourne
e4749e7985 Do not mix QByteArray with QString in arithmetic
QLatin1String + QByteArray + QLatin1String + QString should not be supported.
That the compiler let us get away with this is distressing.
Exposed by Anton Kudryavtsev's workon extending QString's operator+ support.

Change-Id: I0adfaa87e48335928acb680da49e9173639af614
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-03-08 14:20:54 +00:00
Friedemann Kleint
3702622dde manual tests: Fix build
Fix QOverload<void>::of(), causing

../../../../include/QtCore/../../src/corelib/global/qglobal.h: In instantiation of ‘struct QConstOverload<void>’:
     Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW -> decltype(ptr)

and add a missing .pro-file.

Change-Id: I19597adc33f2323a9f7dea9ee5ce94546f0e8f12
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-03-07 22:09:01 +00:00
Friedemann Kleint
464d261aa8 Fix some warnings in manual tests
Fix:
gestures.cpp:46:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
gestures.cpp:47:5: note: here
gestures.cpp:48:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
gestures.cpp:52:5: note: here
main.cpp: In function 'QByteArray windowsVersionToString(QSysInfo::WinVersion)':
main.cpp:40:12: warning: enumeration value 'WV_CE' not handled in switch [-Wswitch]
...

main.cpp: In function 'QByteArray macVersionToString(QSysInfo::MacVersion)':
main.cpp:68:12: warning: enumeration value 'MV_10_12' not handled in switch [-Wswitch]
...

widget.cpp: In member function 'CustomItem* Widget::checkedItem() const':
widget.cpp:238:12: warning: 'item' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: I434784e86d127e56b92663cb45eba7d60d8f8eaf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-03-07 22:06:04 +00:00
Timur Pocheptsov
ef5aefb062 Hpack - fix the static lookup
'accept' breaks the order, making the static table unsorted and thus
std::lower_bound cannot find it and we always index it in a dynamic
table. Also, make this static table accessible to auto-test.
Plus fix some warnings quite annoyingly visible in qt-creator.

Fixes: QTBUG-74161
Change-Id: I47410f2ef974ac92797c9804aa55cb5c36a436c4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-03-04 16:18:14 +00:00
Alex Richardson
47bb74fd15 Fix build with -no-gui on macOS
Some directories that depend on QtGui were being included without the
appropriate check for qtHaveModule(gui).

Change-Id: I7c348c74464d44cbd35a027f188f8a23bb2021d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-04 12:25:53 +00:00
Timur Pocheptsov
01f5d41a40 Make tst_QUdpSocket::lincLocalIPv6 less sadistic
It fails on CI (Windows 10). Given our qabstractsocket disables
read notifications/stops emitting readyRead if it already has pending data
(unbuffered, aka UDP socket type) - make sure we do not suffer from this.
The change does not affect the test's logic (unless the logic was to fail),
it just makes it more fail-proof.

Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197
Fixes: QTBUG-73884
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d3eb9e944a)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-02-28 07:53:45 +00:00
Alexander Volkov
f657c74263 QListView: Fix Shift+click selection for non-default itemAlignment
QListView::setSelection() algorithm is designed for items to
occupy their cells completely, which is not the case when
itemAlignment is used. The middle part of the selection rect
goes beyond the column borders and extra items are selected.

Use the introduced cellRectForIndex() instead of rectForIndex()
to calculate the middle part correctly.

Fixes: QTBUG-73684
Change-Id: I4a1e42a056d56e85a16d8ae0ffe18b78d1d6deb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-27 15:58:56 +00:00
Shawn Rutledge
1500d2283e Clear only one device from g_pointIdMap when all points released
The new test tst_QTouchEvent::touchOnMultipleTouchscreens()
needs the touchpoint IDs to be predictable, but another test currently
has a QEXPECT_FAIL; without release events, g_pointIdMap continued to
hold the touchpoints that were there when the test failed.  So it's
necessary to add QWindowSystemInterfacePrivate::clearPointIdMap()
to be able to call it in the test cleanup function.

Fixes: QTBUG-73830
Change-Id: Ia6a70d028be95cd2b6676db6363ec408c0b116bc
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-02-26 19:52:25 +00:00
Andy Shaw
7e60858cbc Don't edit the item if we did not get the press event on the same item
With a QTreeView it is possible that collapsing an item can cause the
item under the mouse to be a new one and over the checkbox area for the
new item. As a result, a release can cause it to change the check state
even though it did not get the press for that item. This ensures that
it only allows the edit if it got the press as well.

Fixes: QTBUG-61476
Change-Id: I9a0821466afc84c97c9819755ccbacd729f7fbd7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-26 14:18:18 +00:00
Timur Pocheptsov
d3eb9e944a Make tst_QUdpSocket::lincLocalIPv6 less sadistic
It fails on CI (Windows 10). Given our qabstractsocket disables
read notifications/stops emitting readyRead if it already has pending data
(unbuffered, aka UDP socket type) - make sure we do not suffer from this.
The change does not affect the test's logic (unless the logic was to fail),
it just makes it more fail-proof.

Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197
Fixes: QTBUG-73884
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-02-21 11:14:48 +00:00
Tony Sarajärvi
c79b27dbcb Remove "insignificant" flag from qfilesystemmodel test
Due to removal of insignificant flag in
tst_qfilesystemmode.pro a bunch of tests will
either fail or crash in different operating systems.

Task-number: QTBUG-70572
Task-number: QTBUG-70573
Task-number: QTBUG-29403
Change-Id: I44925187acd72e600d2fec4f2604b67c66ecdd6b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2019-02-21 10:43:19 +00:00
Juha Karjalainen
0f163887b5 Fix blacklisting tst_QTimer::basic_chrono()
Blacklisting did not work as blacklist should have contained osx
instead macos

Change-Id: Ifd76a38d371ccce545eb5df030aaa819b00a5b48
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-02-21 05:18:00 +00:00
Kari Oikarinen
33707f5b2f Merge 5.12 into 5.12.2
Change-Id: I3a5721aebd3afd8fa08d3f3df6bf61502fa9c347
2019-02-20 12:37:31 +02:00
Timur Pocheptsov
3a1a97dabe tst_http2::earlyResponse - fix a flaky and somewhat broken test
1. Fix erroneous logic, which was triggered in 'h2' mode (non-TLS connection)
- after the initial protocol upgrade/POST request was handled, the server
(on Windows specifically) was erroneously handling upcoming DATA frames by replying
with another redirect response.
2. Make the test less heavy by sending 1 MB of Qt::Uninitialize instead of 10 MB
- theoretically this could cause a timeout before the redirected request finished
successfully.

Task-number: QTBUG-73873
Change-Id: I961e0a5f50252988edd46d0e73baf96ee22eef3f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-02-20 08:43:48 +00:00
Andy Shaw
4c75934008 Fix a couple of SQL tests
One of the tests was not added to the parent subdirectory pro so this
is also rectified.

Change-Id: I270f1c2882260e3e3fac83d074ed6444c5dece19
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-02-19 11:00:19 +00:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Joerg Bornemann
feb5fdd0cf Fix OpenGL ES2 build on Linux
The feature detection in QOpenGL test project file needed adjustment.

This amends commit dd988e20.

Change-Id: I7efaaec9fbf564be4033e99a8554dbe51322f494
Fixes: QTBUG-73592
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-02-15 12:58:12 +00:00
Allan Sandfeld Jensen
a5cded843f Avoid creating wide images with negative bytesPerLine
The QImage API can not handle images with more bytes per line than what
an integer can hold.

Fixes: QTBUG-73731
Fixes: QTBUG-73732
Change-Id: Ieed6fec7645661fd58d8d25335f806faaa1bb3e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-14 07:48:38 +00:00
Oliver Wolff
a2c9f9433a winrt: Handle WaitForWindowExposed
As winrt does not have native windows, exposure check was just done by
checking, whether the window is the active window. If a window is shown
fullscreen though, winrtscreen will be resized. This resize triggers a
resize of every maximized or fullscreen window that is shown.
If we enter or leave full screen mode, we have to wait until the screen
resize and the subsequent window resizes are done and only then we can
consider the windows properly exposed.

This patch reverts 54bcb9d42f  and thus
unblacklists tst_QGraphicsItem::cursor on WinRT.

Fixes: QTBUG-73545
Change-Id: If469fce319ed6b3a5d56b7bf3cbc11929b72bb11
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-02-13 14:04:58 +00:00
Kai Koehne
d6c474b49b QTextDocument: Do respect white-space:nowrap
Prevent automatic insertion of line-breaks in blocks formatted with 'white-space:nowrap'.
This follows the example of white-space:pre.

Fixes: QTBUG-54787
Change-Id: If26f6a54106a02fe0e388947f6368ae4e86acf63
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-13 08:14:47 +00:00
Andre de la Rocha
80bcfa776f Fix QSpinBox tests failing after change in the Windows QPA
Some QSpinBox tests start failing after reverting to using legacy mouse
messages to handle mouse input in the Windows QPA. It seems to be caused
by a test that runs before it and moves the mouse cursor. Then when the
QSpinBox tests run, they create widgets that appear below the mouse
cursor, causing some mouse events to be generating and messing with the
events synthesized by the test itself. With the pointer messages being
used for mouse input, the legacy mouse messages that are generated under
this condition were being ignored. But by reverting to the old
implementation, the legacy messages are handled again, causing the test
to fail. This change moves the mouse pointer to a safe position during
the test initialization, so it does not depend on the state left by
previous tests. This change needs to be integrated together or before
the change in the windows QPA.

Change-Id: I91f7e9376dc495ee61250e0a7d908c1c2b685bc8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-12 22:17:40 +00:00
Joerg Bornemann
aed1e2c49f Fix warning in tst_qopengl.cpp
This fixes warning: unused parameter ‘glFormat’

Change-Id: I4865300fb99ea5392b96f8e9f4f594f15f18625c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-02-12 13:32:10 +00:00
Lars Knoll
035d80407b Fix two smaller bugs in the BiDi engine
Remove wrong code changing the Bido level of line separators. This
lead to wrong ordering of the string in case the line separator was
meant to be ignored and the string should be rendered in one line. Line
breaks are anyways already reset to the paragraph level by the algorithm
and reordering is done on a line by line basis, so this will work
correctly when doing proper line breaking.

Secondly fix a small bug found while testing the above change, where
we wouldn't set the correct levels for boundary neutrals and explicit
embedding chars because we did that processing before we were fully
done with the BiDi algorithm.

Change-Id: Id88f91cd58d2ab29be864aef34ca1727c1586611
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-02-09 08:01:26 +00:00
Lars Knoll
79f2a9e666 Fix an assertion in the BiDi algorithm
The algorithm has been treating DirB inconsistently so far.
initScriptAnalysisAndIsolatePairs was treating it differently
than generateDireationalRuns leading to assertions.
It wasn't visible in our test data, as DirB is in almost all cases the
paragraph separator, where we split strings anyway.

Change-Id: I7dc0e7bbcf30ee84d8781ea06097da023e371f05
Fixes: QTBUG-73238
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-02-09 08:01:16 +00:00
Lars Knoll
4247d7c5a0 Fix QTextTable:insertRows() for tables with spanning cells
Don't resize the height of cells spanning several columns
multiple times.

Fixes: QTBUG-36713
Change-Id: I5eb45892f2008e6a4f85745b56efd04323e25673
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-02-09 08:01:08 +00:00
Edward Welbourne
c066656aff Avoid read-outside-array error by QStringRef over-reach
Constructing a QStringRef directly from the string, offset and a
length is UB if the offset + length exceeds the string's length.
Thanks to Robert Loehning and libFuzzer for finding this.
QString::midRef (as correctly used in both changed uses of QStringRef,
since 432d3b6962) takes care of that for us.  Changed one UB case and
a matching but correct case, for consistency.

In the process, deduplicate a QStringList look-up.
Added tests to exercise the code (but the one that exercises the
formerly UB case doesn't crash before the fix, so isn't very useful;
the invalid read is only outside the array it's scanning, not outside
allocated memory).

Change-Id: I7051bbbc0267dd7ec0a8f75eee2034d0b7eb75a2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-08 13:56:25 +00:00
Edward Welbourne
150c6fb74b Add testlib selftests for double and for non-finite float and double
Tidied up the existing float tests in the process.
(In particular, s/SUCCESS/PASS/ since that matches real test output.)
These verify that QCOMPARE() handles floats and doubles as intended.
Extended the existing qFuzzyCompare tests to probe the boundaries of
the ranges of values of both types, in the process.

Revised the toString<double> that qCompare() uses to give enough
precision to actually show some of the differences being tested there
(12 digits, to match what qFuzzyCompare tests, so as to show different
values rather than, e.g. 1e12 for both expected and actual) and to
give consistent results for infinities and NaN (MinGW had eccentric
versions for these, leading to different output from tests, which thus
failed); did the latter also for toString<float> and fixed stray zeros
in MinGW's exponents (which made a kludge in tst_selftest.cpp
redundant, so I removed that, too).

That's further complicated handling of floating-point types, so let's
just keep an eye on how expensive that's getting by adding a benchmark
test for QTest::toString().  Unfortunately, default settings only get
runs that take modest numbers of milliseconds (some as low as 40)
while increasing this with -minumumvalue 100 or more gets the process
killed - and I'm unable to find out who's doing the killing (it's not
QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell).
So results are rather noisy; the integral tests exhibit speed-ups by
factors up to 5, and slow-downs by factors up to 100, between runs
with and without this change, which does not affec the integral tests.
The relatively modest slow-downs and speed-ups in the floating point
tests thus seem likely to be happenstance rather than signal.

Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-06 10:11:22 +00:00
Alexander Volkov
f6edb0ef72 Improve keyboard navigation in QListView when isWrapping is enabled
Search the previous item or the next item in a model instead
of searching them on visual layout. This way the cursor will
not stop at the beginning or at the end of a row or a column.

Fixes: QTBUG-14444
Change-Id: I0ef203a4dcd876e4c50559fb87e61585f07434d1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-06 09:50:58 +00:00
Kari Oikarinen
54bcb9d42f Blacklist tst_QGraphicsItem::cursor on WinRT
It is the flaky test causing most failures in qtbase at the moment.

Task-number: QTBUG-73545
Change-Id: Id9c5db27ebd08a4cf3c119d2fada12fdf1a5d2a0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-06 07:17:22 +00:00
Eirik Aavitsland
01f090e9e4 Fix QColor::toCmyk() for rgb(0, 0, 0)
We translate all pure gray colors into cmyk having c,m,y=0 and only
the k value expressing the darkness. But a fix introduced to avoid
division by 0 caused rgb(0, 0, 0) to be an exception to this; it ended
up being translated as c,m,y,k=1 instead.

Fix by catching the potential div-by-0 situation earlier and directly
set the orthodox cmyk translation: c,m,y=0,k=1.

Fixes: QTBUG-73171
Change-Id: I3774eaf9d96e096ac5c47c55d28881bea2bd1309
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-02-05 22:47:33 +00:00
Eirik Aavitsland
66c3a71e91 Painter path stroking: fix capping of beziers ending in tight turns
For some overly tight beziers where the start or end point and the
next control point are closer than the pen width, the stroker's
shifting algorithm will produce a start/end tangent pointing in the
opposite direction from what is expected, for one of the sides. This
would break the square and round capping logic. Fix by detecting the
situation in the capping function and reversing the tangent when
necessary.

Change-Id: I48f4f017403d7b289b0483dd2b3a7ff1bbd0cf2a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-05 22:47:16 +00:00