Previously, QStandardItem::operator<() returned true when both
items had invalid data. With MSVC in debug mode (checked
iterators/STL), this triggered an assert in
tst_QStandardItem::sortChildren() since that verifies
that !(b < a) when a < b:
Debug Assertion Failed!
Line: 3006
Expression: invalid operator<
Introduce a stable sort order for invalid items such that
other items are always less than invalid items and comparing
invalid items returns false (indicating equivalence).
Change-Id: Ica0f0d9f001c86973b1941dbcc1faf282e4c47df
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When a premultiplied alpha changes value because it is rounded to fewer
bits the premultiplied colors may need to be recalculated with the new
value. Otherwise the color will both be wrong and potentially invalid.
Change-Id: I9ec74a22aac73cd7ffab04e180cf2bf35bb4c315
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
- Use QTRY_COMPARE() in touchBeginWithGraphicsWidget.
- Change raw event translation tests to wait for the
window to become active to avoid WM positioning issues.
- Blacklist the raw event translation tests on Linux.
Task-number: QTBUG-46266
Change-Id: I73aae375ee279a518a2a083d0ce8919cce474cb3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Add CONFIG += testcase to the .pro file which was missing.
The test thus was never executed by make check and left to
rot.
Fix up code:
- Remove module includes.
- Introduce explicit constructors taking parent object
for helper classes, removing calls to setParent().
- Ensure test does not leak objects by converting pointers
to stack variables or introducing QScopedPointer, verify
by checking for an empty window list in cleanup().
- Simplify code by removing unneeded variables.
- Split up conditions in QVERIFY().
Fix tests:
- Show windows were required when events are sent to
QWidget::windowHandle().
- Invert the conditions checking whether touch events are
accepted by widgets since widgets no longer accept them
by defaults in Qt 5 after
e50416066c.
- XFAIL multiPointRawEventTranslationOnTouchPad()
which started to fail at some point in Qt 5.
- Mark as insignificant on OS X due to crash.
Task-number: QTBUG-46266
Change-Id: I6676d021afb015411a24d97d9b8f7c327d4d3c3f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This should allow us to make the rest of 14.04 enforcing
Change-Id: I37f6751e8b966b047d1bd2e49ba9482e5846acb1
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Make it possible to read images with EXIF orientation automatically
applied. This was originally implemented without opt-out in Qt 5.4, but
reverted. Here it is implemented as opt-in for JPEG, and opt-out for TIFF
to keep behavioral consistency.
The EXIF support for JPEG was written by Rainer Keller.
[ChangeLog][QtGui][Image plugins] An option has been added to
QImageReader to enable automatic application of EXIF orientation.
This behavior was default in Qt 5.4.1, but reverted in Qt 5.4.2.
Task-number: QTBUG-37946
Task-number: QTBUG-43563
Task-number: QTBUG-45552
Task-number: QTBUG-45865
Change-Id: Iaafd2519b63ede66ecc1f8aa4c7118081312b8f5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Completes the inplace converters so that we can rely on inplace
conversions to succede as long as the image depth is the same.
Change-Id: Ia1ae34b5de1bc16e87ff5403bdacfcae44a22791
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Some inplace conversions would not set the requested image format in
the returned image, due to the same conversion being used for several
destination formats.
This patch ensures all inplace conversions return the right format,
and adds testing infrastructure to easily test iterate over all formats
so that they all can be tested.
Change-Id: I68ab17a713ddb2aa8ed6aaf0a0a1ec8bbcb56090
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The one converters from RGB30 was misplaced in the method table, and
the unpremultiplication from A2RGB30 to RGB30 had an underflow mistake
when alpha was 2.
Change-Id: I92c11ede28611a3dbdce72aca1898845c120c209
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Due to a behavior change.
This reverts commit 9157087334.
This reverts commit 16c32c6dfb.
Task-number: QTBUG-37946
Task-number: QTBUG-45552
Task-number: QTBUG-43563
Change-Id: Idf8df7d8f22465e8f6b51acb68993ac97208b184
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Some QImage methods were not preserving image metadata, or only
preserving some of it. This adds the missing parts and adds a test for
metadata.
Change-Id: Ib5892a23e49dfde5ea26074d3deaa887fa930c6b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The QImage inplace mirroring method, failed to handle the middle line
when mirroring both ways (rotate 180). In both other mirroring cases
the middle can be left untouched, but in this case it needs to be
mirrored half way.
To make the logic simpler, double mirroring will now mirror half the
lines instead of half of every line.
Change-Id: Iaa1f1e1c3f7dedfb78891fc93207f6d0c64bcafe
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Could causedSSE4 instructions to be used on non SSE4 machines
in cases when qUnpremultiplywas not inlined.
This reverts commit 964ccc5853.
Change-Id: Ic676ade8f75129e8d37c4d96cbfb2bdb5b794919
Task-number: QTBUG-45741
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In order to obey a palette set globally on QApplication, an application
attribute for checking if it's set at all is added.
Task-number: QTBUG-39800
Change-Id: I26b965e6e18e0e1ca4df03cf343b3527df3636b2
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Merges the SSE4 specific unpremultiply with the normal version, and
adds a SSE2 fallback. There was no reason to split the two since
compile time options will ensure the right version is inlined.
Also adds short-cut for 0 and 255 values.
Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This will be essential on Linux, especially Embedded where PCI IDs are
not that useful.
Change-Id: I2fa8ca07236e8aae203e21fe629d12aab092c7fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Cleaning up smoothscale code. Upscaling is improved using existing
optimized interpolation methods, and downscale is given SSE4.1
optimized versions.
Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
...which constructs a quaternion using specified forward and upward
directions, so that the resulting Z axis "faces" a given forward direction.
Change-Id: Ib77b8ab5c359a4880b0d946face87026acdc6f0b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
When CSS is set in a head tag then it was not being inherited by the child
tags when the CSS specification indicates that the properties are in fact
inherited. This ensures that those properties are inherited and the non
inheritable ones are unchanged.
A test is added to cover the different situations with inheritance and a
fix is done for the QTextDocumentFragment test which was passing despite
having incorrect defaults.
Task-number: QTBUG-28770
Task-number: QTBUG-34153
Change-Id: I55966240845a885852a04ecb82c61926dea9f800
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
If a cosmetic polyline contained a 1-pixel segment, the next segment
would be drawn with wrong starting point.
The original fix for QTBUG-26156 had some unwanted side effects
(QTBUG-31579 and now QTBUG-42398). It tried to skip start-point update
if stroke() did not actually draw anything (because the segment was
too small). However, to determine that, it tested for a change in
lastPixel. But that was not failsafe; in some cases (1-pixel segment),
lastPixel could be unchanged even though the segment had been
drawn. With this change, we instead test directly whether stroke()
skipped the segment or not.
Task-number: QTBUG-42398
Change-Id: Id751db69a18cd1af4f45070db9d5698aa532d22a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Fixes the drawn position of end points in drawLine.
Based on a patch by Jørgen Lind, and modified so that
it caused no test regressions.
Task-number: QTBUG-38144
Change-Id: I24aa28480cc6ae09abf91d80378970565a29b254
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
On some platforms show() may result in the window being shown full
screen, depending on the defaultWindowState of the platform. If
that's the case, the resulting window size does not follow
the requested size (though the internal normal geometry should).
We need to use showNormal, so that we guarantee that the window
state is WindowNoState.
Change-Id: Ied080eaca13d759501ea292b5e6b2df4e3b32426
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Use qmath and cmath methods instead of math.h methods.
Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
which returns the shortest arc quaternion to rotate vector from
to the destination vector to.
Change-Id: Ibd7a746789ecdfe6f7fe17e4ac9049f7ac46560d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
It is just a convenience wrapper
around convertion to/from the rotation matrix.
Change-Id: I27511b43866827172960b0152f1c7b65da857f6f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This continues 68762151db
When doing format conversion, the optimized inplace codepath did not
check if the image data was external, i.e. if the QImage had been
created by the constructor taking an existing external buffer.
The previous commit fixed the readonly case. But in the case of the
QImage constructor taking non-const uchar*, data will be read-write,
but still external. This would of course crash if the converter tries
to realloc it.
Task-number: QTBUG-44610
Change-Id: I94d275d464e8af221682b538fc3e4897a59c061e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Improves the conversion from RGB888 to RGB32 on platforms without SIMD
versions. This includes the fallback used on non-neon ARM devices.
Besides image conversion the routine is also used for decoding JPEG.
On x86 this version is within 0.7x of the speed of the SSSE3 version.
Change-Id: Id131994d7c3c4f879d89e80f9d6c435bb5535ed7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
According to the Qt naming policy, methods that return value(s) via
the mutable parameter(s) should have "get" prefix to mention that.
[ChangeLog][QtGui][QQuaternion] Added methods to convert a quaternion
to/from Euler angles and to/from rotation matrix.
Change-Id: I95704e1f4623dc4ca54cd237ea203539fb60d452
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
When doing format conversion, the optimized inplace codepath did not
check if the image data was readonly, i.e. if the QImage had been
created by the constructor taking an existing external buffer.
Task-number: QTBUG-44610
Change-Id: I085ff8da427bc4ee392f548dffd2418b63148965
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Make styleHints a static member variable of QGuiApplicationPrivate and
fix accessor accordingly. Extend tst_QApplication::settableStyleHints()
to run without QApplication instance as well and add a similar test
to QGuiApplication.
Task-number: QTBUG-44499
Change-Id: I42b92ef38f7dd512d08d70accfa7dd4f09a22f01
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Currently Qt uses the QPlatformIntegration::StyleHint
SynthesizeMouseFromTouchEvents to check whether to synthesize mouse
events from touch events. But not only platform plugins can produce
touch events, they can be created by e.g. QTest::touchEvent() and in
this case we almost definitely need synthesizing regardless of the
platform.
This commit introduces a QTouchDevice::MouseEmulation capability which
replaces use of the QPlatformIntegration::SynthesizeMouseFromTouchEvents.
So it's possible to pass QTouchDevice without this capability to
QTest::touchEvent() and be sure that mouse events will be synthesized.
Notice that touch pads always emulate mouse events.
As a result we can activate some tests which were disabled for specific
platform configurations by commits 6c1670d8c2
and e9760f1559.
Change-Id: Idc82fa4007a095fc1cb5934979361b0023d2b793
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
When the default font has the pixel size set instead of point
size, then pointSize() will return -1 and the output from the
HTML will include the pixel size instead. This happens e.g.
on Android when we extract font information from the system.
Change-Id: I26dc49fff215c9887cf0b78dcfff88df0f74450d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
We must do something when requestUpdate() is called on a QWidgetWindow.
The semantics of UpdateRequest for QWindow and QWidget are unfortunately
different: for widgets an UpdateRequest means "sync the backing store".
For QWindow it also involves marking as dirty.
Change-Id: Idf40b3fc0873652dc081edeb12c96b3007a126ef
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
- Add support for reading out feature lists from GPU bug lists
in Chromium format (supporting OS + version, exceptions lists,
device ids and vendor ids).
Add a overloads allowing for passing file name,
data or JSON documents.
- Test reading in tst_qopenglconfig
- Prototypically have the Windows plugin read the file
from the environment variable "QT_OPENGL_BUGLIST" and
turn off renderers depending on the standard keyword
"disable_d3d11" and newly introduced keywords
"disable_d3d9", "disable_desktopgl".
- QT_OPENGL_BUGLIST can point to an absolute or relative
path, in which case it is resolved via QLibraryInfo::SettingsPath
and QStandardPaths::ConfigLocation.
[ChangeLog][QtGui][Windows]
Introduce experimental feature allowing the user to specify
a GPU driver buglist with some additional keywords to chooose
the GL renderer backend depending on GPU.
Task-number: QTBUG-43263
Change-Id: I8c20b0e8ee3cf575b91d0672bf405c42d3e9fb64
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This operation is the exact opposite to QQuaternion::fromAxisAndAngle()
(so that it is a way to extract the axis and angle values suitable
to create the same quaternion via QQuaternion::fromAxisAndAngle()).
Change-Id: I41fda58f5fb2b867cccd6b2faf58ab671fa070da
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
We've been setting the -Zm argument since the dawn of times (even before
the first git commit). Anyhow, MSDN from VS2008 onwards indicates
that this is not needed:
"In earlier versions of Visual C++, the compiler used several discrete
heaps, and each had a finite limit. Currently, the compiler dynamically
grows the heaps as necessary up to a total heap size limit, and requires a
fixed-size buffer only to construct precompiled headers. Consequently, the
/Zm compiler option is rarely necessary."
[ChangeLog][Compiler Specific Changes] Visual Studio: -Zm200 (an option to
specify the precompiled header memory allocation limit) is not added anymore
by qmake to the compiler calls. If you encounter an C1076 compiler error you
might need to re-add it in your .pro file.
Change-Id: Ia4bec7eba09d893a7d81886a1814602b9ce7563c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QPlatformTheme::keyBindings() performs a binary search
into an ordered list of StandardKey -> Key Sequence
mappings where each StandardKey can have multiple
key sequences.
Previously the order of the Key Sequences in the
returned list would be indeterministic and, except
for the designated pri-1 key sequence, would not
necessarily correspond to the list order. (The
ordering was dependent on where the binary search
"hits", which again depends on the size of the list.)
This caused trouble when adding mappings, since it
would change the order in the returned key sequence
list for existing mappings and confusingly cause
(apparently) unrelated test failures.
Fix this by replacing the manually coded binary search
with std::equal_range.
One test case needed to be fixed up because it had the
result in the wrong order (verified by looking at
QPlatformTheme::keyBindings).
Change-Id: I555ca2736b1a8e6454dc79645a8246f80119cfc2
Done-with: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>