We shouldn't create QPixmaps when comparing QBrushes that do not
contain a QPixmap.
This patch extends the comparison logic to comparing QImage cachekeys
if the brushes are QImage based.
Note the comparison still produces false negatives on equal content on
different pixmaps and images, but this is preserving existing behavior.
Task-number: QTBUG-43766
Change-Id: I001b4032172c1e568aad311f7df2eaae6aee8dc6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.
In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.
Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit fixes incorrect logic of icons' lookup if there are
fallbacks or more than one theme's directory.
According to Icon Theme Specification, Directory Layout section, theme
can be spread across several base directories by having subdirectories
of the same name. This makes possible to extend system themes by
application-specific icons without making of collisions with other
applications.
According to Icon Naming Specification, Icon Naming Guidelines section,
icon name may contain dashes to separate levels of specificity in icon
names. This makes possible to set in application very specific icon
which may be not in every theme. So it can fallback to less specific one.
Change-Id: Iafc813902a3646be56e8f1d3a2fdbf8fd32ac542
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
If a QBrush has been created without QPixmap the texture() method will
create one. This patch avoids that in several places by checking the
type of the texture brush before accessing it, or not accessing it at
all.
Task-number: QTBUG-43766
Change-Id: If6009fe1d5bd51b239ae2c838e5c3b904b56b11a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
rawMode only has an effect under X11 in pre-QPA times.
Change-Id: Iaff8fed8f4ae5af5dd0399bb3ebd9d590a39a758
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Equivalent of gluProject and gluUnproject.
[ChangeLog][QtCore][QVector3D] add convenience project and unproject methods
to use like gluProject and gluUnproject
Change-Id: I6e4e3e79ea6e34d1fb0c375e15185c950b699ef0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
tst_collections.cpp
tst_collections.cpp(3138) : warning C4305: 'argument' : truncation from 'size_t' to 'bool'
tst_collections.cpp(3190) : see reference to function template instantiation 'void testContainerTypedefs<QVector<int>>(Container)' being compiled
with[Container=QVector<int>]
(repeated)
tst_qringbuffer.cpp(297) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
tst_qringbuffer.cpp(300) : warning C4309: '=' : truncation of constant value
tst_qringbuffer.cpp(306) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
tst_qrawfont.cpp(947) : warning C4309: 'argument' : truncation of constant value
tst_qsslsocket_onDemandCertificates_member.cpp(217) : warning C4189: 'rootCertLoadingAllowed' : local variable is initialized but not referenced
Change-Id: I6143d4ad121088a0d5bdd6dd2637eb3641a26096
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
The auto-hinter in the FreeType version bundled in Qt gives
slightly different advances on some glyphs. As noted in
the removed code, this was already observed on Windows and QNX,
and recently also on Android.
I'm sure it could also happen on platforms using the system library
if the system library was the same version as the one bundled in Qt.
Instead of expect-failing the test, we simply accept both the
observed results as valid.
Note that we need to accept 9 as a result for the default hinting
preference on all platforms, not just Windows, since the default
hinting preference in FreeType can be a system setting.
Change-Id: I3cc0f33f0f66dd64419770b37c10dee457706b5e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The files for the test have to be included in a qrc to be available on
Android.
Most of the image files are already in a qrc, but a couple were missing.
We add this in a separate qrc to avoid interfering with the tests on
other platforms.
Change-Id: Ibb24f5015a1aba4d5622e14f7aae80bc18611ec4
Reviewed-by: BogDan Vatra <bogdan@kde.org>
On e.g. Android, the tabs will be scaled by DPI. This breaks the
logic in the QTextLayout tests for tabs. It's not possible to
just scale the expected sizes either, since the whole text layout
will be affected by font sizes and scaling, and it's difficult to
predict where characters will land on different platforms and
resolutions.
To avoid breaking this test on other platforms, we just skip them
when we know they will break. Since the code tested is
cross-platform, this will hopefully not have any significant
impact on our coverage.
Change-Id: I65d6c33c9c6724665983a17f99eadcf1baedcc20
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Add all test data to resources.
Change-Id: I31b0dbb7546a15151f64523c86bf8eb687ff9ec0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: I1b18415cd53a27bd23e51ac6b738d3ed94162ac9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
QWidget is polished when show() is called, so unless you do this
first, QWidget::font() will return a default constructed QFont,
and not necessarily the default specified in the platform theme.
Comparing this to QPainter::font() later, which has been resolved
against the platform theme font, and not the default constructed
font, you can get a mismatch and a false test failure. This
happened on Android.
Change-Id: I41ef5b10879bbd4bb8ef8d52ecaccf5e8e894075
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The testdata needs to be in a qrc to be available on Android.
Note that a single test will still fail. Since this requires
a platform-independent fix, it will be committed separately.
Change-Id: Ib2438a3298d81d77b7f4f240ef045aa0500d8382
Reviewed-by: BogDan Vatra <bogdan@kde.org>
We must add all test data to resources. Write output data into a writable location.
Change-Id: I5a1c212f6108abf2a82288a2c84cfb31eda5e101
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The change 35bc3dc45a moved some padding out
of QTextureGlyphCache into the font engines directly, however this was not
done for the DirectWrite font engine so it caused a buffer overrun.
Task-number: QTBUG-41782
Change-Id: I4e643159036f06c5edd8a742dc6694d517a47826
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The orientation is unsigned short, read it as such. In
JPEG-files created by Ricoh/Pentax cameras, the data is saved in
Motorola format. Reading the wrong data size will produce invalid
values when converting the byte order.
Change-Id: I8f7c5dc5bfc10c02e090d3654aaefa047229a962
Task-number: QTBUG-43563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Behavior will agree with the docs.
[ChangeLog][QtGui][QWindow] lastWindowClosed will be emitted even if
quitOnLastWindowClosed is not set
Task-number: QTBUG-32956
Change-Id: I7bb269d53894859fee27e171eea7ad472ea86af0
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Add all test data to resources.
Change-Id: Id42a4c033b75409f65cb4d56ebf1161336b93832
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: Ic12f8fce9afb965aff32e7141516c8d223e64491
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: I7f9e7650156b174b7c16270d86b78e9408dff254
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Our theory for the failure of framePosition() not having the expected
value after setFramePosition towards the end of the test is that we try
to call setFramePosition() while the getting-back-from-fullscreen-to-normal
window animation is still running, at which point the compositor may
just choose to ignore our move request.
Similarly to when going fullscreen, also wait when coming back from it.
Change-Id: Icfc92f277d96dccdfad772c4aac252b2a20c6196
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
The Qt bug tracker URL changes as part of the qt.io transition
Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
The test still fails sporadically at a new place, so this adds some
debug information when it fails to may help us identify what is going
wrong.
Change-Id: Ife0f171299ef7e800a2d808602e76ca2f3885964
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
The calculateTabWidth() can trigger shaping of the item, which can
cause the layout data to be reallocated, so we need to update the
local pointers to it, like we do when we explicitly invoke the
shaper.
[ChangeLog][Text] Fixed problems with text layout when using custom
tab stops.
Task-number: QTBUG-43126
Change-Id: Ifaeeeb4bfb1a55e6638b12b444f53d2679d3d1e6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The part of the test that verifies that setFramePosition moves the window
successfully appears to be very unreliable in the CI system. The "tested"
frame position is calculated to be at (40, 40) relative to the top left
of the available screen geometry, which can be non-zero due to task bars
and similar system ui elements. However that position appears to be
unreliable in the sense that the window manager doesn't seem to always
respect that. So instead let's try placing the window (by frame position)
in the center of the screen instead.
Change-Id: I96fe6c37e748fc18262632b5effe5a9e90dc0028
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Don't check for absolute counts of resize events but just check if we
were resized. Also use QTest::qWaitForWindowExposed instead of QTRY_COMPARE
and checking for QEvent::Expose.
Change-Id: Ie383493a8ce6d88cad50bd6375d432ad1578449c
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
QRegularExpressionValidator and QRegularExpression disagree on what a
partial match means.
[ChangeLog][QtGui][QRegularExpressionValidator] Allow empty string as
intermediate match
Change-Id: Ia6c55beb54870b1be5c88b6ef3eceebc8ca3f86b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
These synchronously delivered events allow applications to correctly
and conveniently handle native platform surfaces being destroyed. This
is particularly useful when doing rendering on a non-gui thread as it
allows to shutdown rendering before the native surface gets destroyed
from under us.
Task-number: QTBUG-42476
Task-number: QTBUG-42483
Change-Id: I63f41bbdb32f281d0f3b8ec2537eb2b0361f3bb3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Adds special shaders for the Alpha8 and Grayscale8 formats so that
they do not need to rely on the support of GL_ALPHA and GL_LUMINANCE
that has been removed from core in recent OpenGL versions.
Change-Id: Ie370379b458abf2a50e252bc5099aefc1b11fb1d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The sample lineedit in Qt's own font dialog shouldn't have its font
affected by stylesheets.
Not only does this hampers the ability to preview the font, it actually
overrides the font selection as that one is taken directly from the
widget.
Task-number: QTBUG-41513
Change-Id: I11d0bef8c7bf7bdae4cc08b6b9276d0fc14a75fb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
The setMimeData() function is documented to take ownership of
the object passed in, but in the case where the platform
plugin did not support the requested mode, we would simply
return without deleting the object nor telling the application,
so it would cause a potential memory leak. We need to honor the
contract, even when we fail to set the mime data.
Test was updated to avoid verifying the leak in cases where
the platform does not support all modes.
[ChangeLog][QtGui][Clipboard] Fixed a memory leak in setMimeData()
when the platform plugin did not support the requested mode.
Task-number: QTBUG-41852
Change-Id: I2112da1613199fe1b56724e7ccf097b9e912c117
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>