QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTableWidgetItem setData() function
Task-number: QTBUG-48295
Change-Id: I82289b6db78eeef09d586da267046032984952da
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QHeaderView::reset() did not reset the cached size hint which could lead
to wrong geometries when the model was reset.
Task-number: QTBUG-67927
Change-Id: I5100b28a741cc816133a229c422f9abf83f2187e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
tst_QHeaderView::sectionSizeHint() did set some values but did not check
the return values.
Change-Id: Id606d7a06935a3d6783bc9a8c10bf05d953adec6
Reviewed-by: David Faure <david.faure@kdab.com>
This supplements b1945604a7, which
removed the qrc file in favor of test/test.pro coding for it.
Change-Id: I15507c89ca14fa6e6b8223de671ffff7092272d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Replace with QSignalSpy or QTRY_COMPARE when possible.
Task-number: QTBUG-63992
Change-Id: I18dc8837301424855487a12ee62451a5aeb21bf0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Put it in alphabetical order like the rest of the list.
Change-Id: I3da3bb68d1847f53419bb79490b946c935ebb518
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
They didn't exist up until now, and future patches rely on them, so
add them.
Change-Id: I8afdb9417263b45d43355c688a813bdf99ea5fc8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
The test relies on the existence of qt-project.org in resources. It
contains mimetype data and is automatically added. For static builds on
MSVC it is only added if it is actually needed though.
Change-Id: Icd1d74466607196f9b635205f7cb4d9b300ec4b8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If builtin_testdata is present additional data ends in inside of
resources so that tests can access this data when needed. The addiitonal
data has to be taken into account in the resource engine's test.
Change-Id: I10de6b9612ca49b314d77cfadd5b2360a5d90d53
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I399cc1aed3ee4151cf6adfd8f8780d8975604d52
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
The formatting of the output from QSslCertificate::toText has
changed slightly from before, so it no longer matches the test's
data.
From what I can tell we just do a manual sanity check and create
a new file with the new output and then augment the test.
Task-number: QTBUG-67463
Change-Id: I751e5a3f9a28015f97c895cea47384704fd68e38
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The added test case is the binary JSON equivalent of
{"a":{"š":null}}
with two modifications. First, the length of the string "š" has been corrupted
to 0xFFFFFF00. Second and more import, the Base::size field of the inner object
has been reset to 0.
On its own the first modification would normally trigger a validation error.
However, due to the second modification the Value::usedStorage for the inner
object evaluates to 0, completely disabling all further validation of the
object's contents.
Attempting to convert this binary JSON into standard JSON will lead to the JSON
writer trying to construct a QString of length 0xFFFFFF00.
Fixed by validating also objects with usedStorage == 0.
Task-number: QTBUG-61969
Change-Id: I5e59383674dec9be89361759572c0d91d4e16e01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The added test case is a binary JSON file describing an array which contains
itself. This file passes validation even though attempting to convert it to
plain JSON leads to an infinite loop. Fixed by rejecting it in validation.
Task-number: QTBUG-61969
Change-Id: Ib4472e9777d09840c30c384b24294e4744b02045
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This method takes a pointer+size pair, but begins reading through the pointer
without first checking the size parameter. Fixed by checking the size parameter.
A new test case is added with an empty binary json file. Although the test does
not fail under normal conditions, the problem can be detected using valgrind or
AddressSanitizer.
Task-number: QTBUG-61969
Change-Id: Ie91cc9a56dbc3c676472c614d4e633d7721b8481
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the application closes, we should clear the cache to not run into
memory sanitizers claiming that we leak.
Change-Id: Ibf9fcda107be6b7f3ed414d7651080aa1f61a3a5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
This allow to customize easily placeholders in QLineEdit by example.
Change-Id: I2bb379164376e1d88b42d6c86c2e5b8df99fbc56
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When showing a condensed font with AnyStretch, we should
not apply any stretch to the font (and if a stretch is
requested, we should calculate the actual stretch based
on how much the font is already stretched or condensed).
This usually works as expected, however, when using
QFont::NoFontMerging as the style strategy, we would
scale the glyph advances by the stretch of the font
since the calculated stretch of the font engine would
be overwritten by the actual stretch. In the case where
we use font merging, this would be done for the multi
engine, so we would not get the same issue, since the
text engine gets the stretch from the actual font engine
and this still has the original, calculated stretch
set.
Note on the test: We can't use testString() for this,
since it contains a space, and the test font does not
have a glyph for this, so we will end up merging a
different font for the space, giving us a slightly
different advance.
[ChangeLog][QtGui][macOS] Fixed display of condensed fonts
when NoFontMerging is in use.
Task-number: QTBUG-63800
Change-Id: I5b05e0dbfc8ae4b5d10c621ecb0975f53fda9483
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Sometimes useful to force e.g. an exact match.
Change-Id: Ic417a518d91b579c23dea925f747955f11d4143b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Normally done through the webform, but this option is useful for
scripted running of such tests.
Also option to disable such updating alltogether, to allow runs
that will never modify the baseline suite.
Change-Id: I71cc7564453e63bda7ded2b90be01280c9dbb95a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When the page size was not valid on the new printer, it would end up
having the wrong page size name on the new printer. What should happen
in this case is that it should set the originally set page size as a
custom page size on the printer instead.
Task-number: QTBUG-62221
Change-Id: Iaca34ae262f5d0685ca60e4ca4b38229a2283289
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
- Add a display label showing the screen parameters.
- Add a menu option to launch secondary windows and restructure
the code accordingly
Change-Id: I2bdb76da0b0a00e62db41e674aa93cef9598fe67
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The reason it crashed was this:
1. Button was pressed => _panTimer started with the graphics view as
destination.
2. Button was released => the graphicsview is destroyed
3. 300 ms later: Qt tries to deliver TimerEvent from _panTimer to the
graphics view. Unfortunately, the graphics view is deleted, but Qt
doesn't know that... (*crash*)
We therefore chose to start the timer with a destination we are controlling the
lifetime of: the QMacPanGestureRecognizer. Inside the timerEvent of that we can
check if the actual target is already destroyed.
Task-number: QTBUG-60404
Change-Id: Iff8f5b7217de42c4c5cf551ca507f0cff1c99a78
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
paintEventCount() is currently flaky on macOS. It gets extra paint events after
qWaitForWindowExposed() returns, which causes the following assertions to fail.
Add the wait that was removed in 0cb940b1d3 back
to fix those failures.
Task-number: QTBUG-68032
Change-Id: I68e0b6008de40922ec740291dfdd1842e0f62f89
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This warning was removed when we refactored QCocoaMenuItem::sync().
This change amends 8412009de6.
Task-number: QTBUG-68013
Change-Id: I0d65109dff5f82db530b6bdced96c05692af6b4b
Reviewed-by: Liang Qi <liang.qi@qt.io>
Replace the code for isRowSelected and isColumnSelected with
a much simpler algorithm for deciding if a row/column is selected.
In a model with a cross-hatch of unselectable indexes, the return values
of is(Column/Row)Selected would depend on the order in which the
selections were done.
Task-number: QTBUG-18001
Change-Id: I6aa4b1df7c07fae469a686041927fa8c42bc9b16
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Home/End don't actually work on macOS. The "select all and delete" key
was not actually testing anything at all.
Change-Id: I44d3e9dd27da418afd699bf8720d5369325d20df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Introduce C++11, nullptr, for, port to Qt 5 connection syntax.
Change-Id: I2d233ccd68bad533af8d4674d91236b2c049e997
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
... but only if the host it came from is an EXACT match. Also only apply
the cookie if the url is an EXACT match.
[ChangeLog][QtNetwork][QNetworkCookieJar] Cookies will no longer be
rejected when the domain matches a TLD. However (to avoid problems
with TLDs), such cookies are only accepted, or sent, when the host name
matches exactly.
Task-number: QTBUG-52040
Change-Id: Ic2ebd9211c48891beb669032591234b57713c31d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Checking for Q_OS_LINUX, Q_PROCESSOR_ARM and use of QT_CONFIG() checks should
only happen after qglobal.h is included. Otherwise the header will be broken if
included before something that uses qglobal.h
Change-Id: I052e46784f7b174e74e8894e1b7c5b7528420f5d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
checkReason_ActiveWindow() started failing on Windows when run together with
other tests, but still passed on its own.
The offending tests was checkReason_focusWidget(), which showed a window but did
not wait for it to be active.
After adding this wait the whole test executable passes on Windows as well.
Amends fd87c8da82.
Change-Id: I384bc45176fcd7bf6f491a4f39b46464ba45693b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This way the platform window is destroyed in a timely manner, preventing
redundant close events from the window system.
Task-number: QTBUG-43344
Change-Id: Ifdfca59ceacef54405f1c227c493dc514a1b27ea
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Instead of a local wrapper for it.
Change-Id: I0708dfad44b3db0c7a13e75ba5b4193ab50ac315
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Implement more consistent behavior for drawTiledPixmap(),
which should produce the same visual tiling pattern
independent of display devicePixelRatio
Consider the following pixmaps and draw calls:
QPixmap px32; // 32x32
QPixmap px64; // 64x64
drawTiledPixmap(QRect(0, 0, 128, 128), px32);
drawTiledPixmap(QRect(0, 0, 128, 128), px64);
On 1x displays this will produce 4x4 and 2x2 tiles,
respectively.
On 2x displays this would previously produce a different
tiling pattern, where the paint engine would tile in
the device pixel coordinate system. Change this to
tile in the device independent coordinate system,
producing the same visual tiling pattern as the 1x case.
It is possible to produce a 4x4 tiling pattern with
high-resolution output from the 64x64 pixmap by setting
the devicePixelRatio:
QPixmap px64;
px64.setDevicePixelRatio(2);
drawTiledPixmap(QRect(0, 0, 128, 128), px64);
This change adds an inverse scale to the image filler
transform that accounts for the pixmap devicePixelRatio.
[ChangeLog][QtGui] QPainter::drawTiledPixmap() now
tiles in the device independent coordinate system.
Change-Id: I4918d274192967f222f181b374571c7c597dcd76
Reviewed-by: Jonathan Courtois <jonathan.courtois@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: 石博文 <sbw@sbw.so>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Although QPainter::drawImage()/drawPixmap() would render images scaled
according to their devicePixelRatio(), that would not happen for
drawTiledPixmap() and when using a textured brush. Implemented here,
in combination with the pending "High-dpi drawTiledPixmap (raster
paint engine)" commit.
[ChangeLog][QtGui] Fix drawTiledPixmap() and texture-brush painting with high-DPR images
Task-number: QTBUG-67248
Change-Id: I037e3f897fa708038a0222d3b0c61c7842d87961
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
- Don't use QCursor when we can position a mouse relative to the
window coordinates via QTest::mouse*() functions. Even the way
QCursor was user here seemed to be hackish. This hack apparently
was there to make the test pass on macOS, I have verified that
the updated test continue working on this platform.
- Remove Q_OS_QNX ifdef, as this test does not depend on QCursor anymore.
- Remove QTest::qWait()-s. Unconditinal waiting should not be used.
- Add better comments.
- Other minor things.
And move tst_QComboBox to use QTEST_QPA_MOUSE_HANDLING code path.
Eventually we want to deprecate the legacy code path.
Change-Id: Ib72f324b5197d0fd66fc32b8c1c7509e58838e04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>