This signal can be used to clean up OpenGL resources in a safe way
before the context is destroyed.
Task-number: QTBUG-20083
Change-Id: I45a4be01b06af4ee7196fa502116f099d50afeab
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Commit d52fd497f6 introduced a call path to
QPaintEngineEx::drawStaticTextItem, which has a bug in using the pen's color
instead of the entire brush.
This patch replaces the use of the color with the pen's brush().
Task-number: QTBUG-23450
Change-Id: Ieb3bf352c840ff0d3fb4ac678caf7b13f4f9a8f1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Use the C++ boolean constants true and false instead of the C macros
TRUE and FALSE (which are actually integers), and use QVERIFY instead of
QCOMPARE for verifying simple boolean expressions.
Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Previously they would fall into the unicode handling and return very
strange values.
Change-Id: I62a53894c0983bf53fd79f924b40a6fd3ba02993
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
GCC 4.6 fails to build the test because of narrowing conversion.
Change-Id: I927693789be7f3df7bd1a96c8924fc04716a03f0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We need that information to perform some optimizations in QVariant.
Change-Id: Id9a1716e49e4cedd17cd09a32fea4ff003ef61f2
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
When decoding a string don't assume valid modifier strings. If a
modifier string is unknown return Qt::Key_unknown instead of skipping
the modifier.
Currently 'Win+a' is decoded to 'A' but should be Qt::Key_unknown.
Change-Id: I1c82031159a8b3c19924a7c9e991bc6b1f90d617
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
QTest::pixmapsAreEqual() was left in the Qt4 API for compatibility with
some old tests written for Qt3. QCOMPARE() is the preferred way to
compare QPixmaps and provides superior diagnostic output when a
comparison fails.
This commit removes QTest::pixmapsAreEqual() from the testlib API and
replaces the last few remaining calls with QCOMPARE.
Change-Id: I051c0e7d3bda072855fcd262d82e8e540619233b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
The duplicated hash tables in QGuiApplicationPrivate and
QApplicationPrivate are now unified into one single hash table in
QGuiApplicationPrivate. This also reduced the number of lookups.
The extra processing needed to keep the touch points' first/lastPos
values in sync is now done only once, in QGuiApplication. This
eliminates the performance penalty (for widget-based apps) that was
introduced during the QPA migration.
As an added bonus the patch adds support for touch events arriving
simultaenously from multiple devices. This was broken before: As there
is no guarantee that two devices/drivers will not send touch points
with the same ID, using structures with only the ID as key is
wrong. The proper key is composed of the device ID (that is, a
QTouchDevice pointer) and the touch point ID.
The exported internal function qt_translateRawTouchEvent() has been
removed. This function cannot work properly in the QPA world: It
injected touches into the widget subsystem (QApplication) only which
is wrong, and would result in half-filled touch events due to not
routing the injected data through QGuiApplication. Autotests using
this function are migrated to
QWindowSystemInterface::handleTouchEvent().
Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
- Add some QVERIFY to check for isNull().
- Use QTemporaryDir to avoid spurious failures in the format
extension-ignore test (cannot copy to '/tmp/black.jpg').
Change-Id: Ia57ea4daa6b8686d1111c9c27a47666265fa9781
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The test that was failing was the readFromDevice one - where the
extension is not known.
Looks as though image detection is required in a positive way, that is
it is not enough to say I think I can read this file, and then fail if
the format is "corrupt", you must be certain that the file was intended
to be that format.
In the case of TGA the original format has no magic byte header, and no
consistent way to check if it really is a TGA file. With 2.0 the footer
was added at the end, so that can be checked for confirming the file is
TGA. However rejecting files which do not have this means that old TGA
files will not be read.
On a quick survey TGA files that have been used in applications so far
all seem to be 2.0 TrueVision, so for now, lets just reject earlier
files and see how it goes.
Also add reading the tga test file to the readFromDevice test.
(cherry picked from commit 665bc3951709f0d726cb82501a5bca684f3347a5)
Change-Id: I665bc3951709f0d726cb82501a5bca684f3347a5
Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had
no equivalent so one had to fall back to reimplementing event() or
using an event filter. This is now corrected by introducing
touchEvent(). Touch events are finally becoming a first-class citizen
in Qt 5.
Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
The capability flags indicate which information is valid in the touch
points. Previously there was no way to tell if e.g. the value returned
by pressure() is actually the value provided by the driver/device or
it is just something bogus due to pressure not being supported.
The points' flags return information about the individual touch
points. One use case is to differentiate between touches made by
finger and pen.
Velocity, if available, is now also exposed.
Each touch point can now contain an additional list of "raw"
positions. These points are not reported individually but are taken
into account in some way by the underlying device and drivers to
generate the final, "accurate" touch point. In case the underlying
drivers expose these additional positions, they are made available in
the lists returned by the touch points' rawScreenPosition().
The raw positions are only available in screen coordinates to prevent
wasting time with mapping from global positions in applications that
do not use this data. Instead, apps can query the QWindow to which the
touch event was sent via QTouchEvent::window() and can call
mapFromGlobal() manually if they need local raw positions.
The capability and device type information is now held in a new
QTouchDevice class. Each touch event will contain only a pointer to
one of the global QTouchDevice instances. On top of type and
capability, the new class also contains a name which can be used to
differentiate between multiple touch input devices (i.e. to tell from
which one a given QTouchEvent originates from).
The introduction of QTouchDevice has three implications: The
QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent
need to be changed (to pass a QTouchDevice pointer instead of merely a
device type value), and each platform or generic plug-in is now
responsible for registering one or more devices using the new API
QWindowSystemInterface::registerTouchDevice.
Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
- QPixmap::to/fromWinHICON/BITMAP() became free internal
functions (see b8d330904b)
- Improve QImage check function similar to
11732d133b
Change-Id: I80ff066964ce6c339a6b9bfa5a0e10421dca162a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Failing tests are marked with CONFIG+=insignificant_test.
tst_QTextLayout currently asserts, so it has been disabled to prevent
destabilization of the CI system.
Change-Id: I7bd836ee14085689c8a0f0ce8e3c80d81a55eb94
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
These comments were mostly empty or inaccurate. Appropriate naming of
tests and appropriate placement of tests within the directory tree
provide more reliable indicators of what is being tested.
Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
QApplication::setGraphicsSystem() is a no-op, and even if it wasn't it
would be unwise to force a graphics system that isn't guaranteed to be
included in the Qt build, without including any logic to skip the test
if setting the graphics system failed.
Change-Id: Id9a0a87586872088625de7840b5032d0c3cc48a1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The ScreenOrientation enum was changed so that the values are power of
twos, angleBetween() needed to be fixed in order to reflect this.
Task-number: QTBUG-22554
Change-Id: Ia45dd6643b40b14204abf967b00c0d04834736a3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
libstdc++ provides the fenv.h found and for uclibc default toolchains
the bits/c++config.h has _GLIBCXX_HAVE_FENV_H undefined leading to
no import of the uclibc fenv.h
Change-Id: I53173b099f3d8791f527f1ccb60991de57cd19db
Filed: https://bugs.busybox.net/show_bug.cgi?id=4484
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.
This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
924d810dbd8aaff67510338d3f1197a55034062b253497b7447cfad460c59d2ff58f360cf6baa2d6
Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Commit 202127f860 ensured that
QOpenGLMultiGroupSharedResource-owned resources are deleted,
but it was missing a call to invalidateResource().
Change-Id: I166ce8a7298772408081331fe1a91bd2cd88aebb
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
When a GL context group is destroyed, all multi-group shared
resources associated with the group should be cleaned up.
Otherwise we could get a double deletion in the resource's
destructor, because it still retained a pointer to the
deleted group.
The missing cleanup resulted in a crash when the global
static qt_gl_functions_resource was destroyed, first seen
in the tst_examples autotest in qtdeclarative. It possibly
didn't manifest before because it's event loop-dependent
(the contexts are deleted via deleteLater()).
Change-Id: I6b1e0bfdfbbb2bff8e795f545e680fcdfa094768
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
To increase the effective test coverage, this patch
re-enables the tst_qopengl test case as such, and
instead disables only the test functions that are currently
failing in CI.
Task-number: QTBUG-22453
Change-Id: Ifa9ccab81efb1577767465c150fc64a9d9e3f8e0
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
The previous fix a05270f435 is not correct,
QPainterPathPrivate(other) should be QPainterPathPrivate(), as there
is only a default ctor for QPainterPathPrivate and ref is initialized there,
use copy ctor just copies the ref value which makes all detach() calls broken.
Add an unit test for this as well.
Change-Id: I658f0a977664d5ec523af3f8a48c1a866eda6ab0
Reviewed-by: Martin Jones <martin.jones@nokia.com>
To increase the effective test coverage, this patch
re-enables the tst_qprinter test case as such, and
instead disables only the test functions that are currently
failing in CI.
Task-number: QTBUG-22453
Change-Id: I74cc30dc26b8b83852b3516f8def995eab19cf0f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit moves tests from test/auto/ into more appropriate
locations (i.e. matching the locations in the Qt source):
- qscreen and qwindow are moved into gui/kernel/
- qopengl is moved into gui/qopengl/
Note: qscreen is disabled for now since it is broken
on Linux (see QTBUG-22554).
Change-Id: Idcc7a51e78d6d0955bddb9cb4091866659193cc8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
The PlatformQuirks header is, by its author's own admission, based on
"very bad assumptions", those being that only Meego has quirks.
The assumption that only Meego has versions of libjpeg and libpng with
rounding errors is not a good assumption. Change the test to be a
little tolerant of rounding error regardless of the platform, at least
until there's a reliable way to tell which libjpeg/libpng versions have
rounding errors.
Change-Id: Id2be5cc54739249b615bf3307ee1850c0a5c06b3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
When moving cursors, non-stop positions are skipped, however certain
input sequences can still lead us there. In such cases we should
simply ignore those positions in cursorToX.
Task-number: QTBUG-7076
Change-Id: Ia0a25931f4043359f72a6c0c14a74b905e40b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
qt_format_text_clip() and qt_format_text_boundingrect() have been
skipped ever since they were originally added to git, so I see no point
in keeping them.
The #if 0 in setEqualClipRegionAndPath() was ifdefed out from when that
specific test case was added (maybe it was failing to begin with?), but
it passes now, so we should enable it.
Change-Id: I6551e3b5612a4d4b00a969511af6abc85db43892
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Remove the operator_star_qrect() test function. The body of this test
function has been inside "#if 0" since the commit that created the test
in 2006 and the operator it is trying to test doesn't exist. Seems fair
to assume that this function isn't worth keeping.
Change-Id: I9748273b28eae4b07c3a25f77cee412ad94ea822
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Any test diagnostics that are useful should be part of the regular test
output, as the CI system cannot switch on commented-out code when there
is a test failure.
Change-Id: Ic7fb619081e9ff453769f4064431dc726e90b985
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Any test diagnostics that are useful should be part of the regular test
output, as the CI system cannot switch on commented-out code when there
is a test failure.
Change-Id: I36c0624cccf70853a697a2395259b387fa334134
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The removed code was in #if 0 in the original commit of the test
function and appears to be an earlier version that should have been
discarded before the initial commit.
Change-Id: I91f16aa7adcccb50f4f3a02062fb9d105d85000c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This is dead code, unused with QPA in place, so remove it to avoid confusion
caused through grepping for class names existing in both old and new places.
Mac code is left in place for now, as some of it is still in use.
Change-Id: Ia82cd5bbabe71285ca997f79d8fd9c0504e32c28
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Compile without -qpa.
- Make Q_WS_QPA-#ifdefed sections the default in the code
- Replace some Q_WS_ by Q_OS_
- Add ### fixme for places that need checking
- Remove qpa conditionals from .pro files.
Change-Id: I6ea930afc0c236cc12a7b7e95f1b8a1c24b3a513
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Fix typos I was able to find in `tests/auto' directory.
Change-Id: Id0bfcc18301381ac8b1ca8d5af17bd926e5913d4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This commit re-enables tests that are assumed to be ok by now, since they:
- Have been passing in CI for a long time recently (more precisely, not failed once in pulse run range 730-829).
- Did not have any known issues associated with them.
Note that not all of these tests were disabled as a result of QTBUG-21402.
Task-number: QTBUG-21402
Change-Id: I80bbf8b351bd9165aa968e98f4dc17e8be6bc7c3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>