Commit Graph

5944 Commits

Author SHA1 Message Date
Shawn Rutledge
1b0c45f683 Deliver stationary touchpoints that have changed pressure
As a rule, we don't deliver touch events containing only stationary
touchpoints.  To fix QTBUG-52510 we added an exception in
1bd0ab7050 : if the velocity changed,
deliver it anyway.  Now we need to do the same if the pressure changed.

Also, on the customer's hardware, pressure is indicated via ABS_MT_PRESSURE.

Change-Id: If7f7088df055d686cdd86967b999e38024f8170f
Fixes: QTBUG-77142
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-02 20:25:06 +02:00
Alexander Volkov
98c5f22161 Avoid invalid memory access in QIconCacheGtkReader::lookup()
If name argument is empty, e.g. an icon is created by
QIcon::fromTheme(""), then icon_name_hash() will access
a byte at index 1, which is outside of the string.

Change-Id: I109c476718939d7dd252007ebac48c3dbbeceb72
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-02 20:51:59 +03:00
Kai Koehne
351f6eb52b Add Third-Party code in qregion.cpp to qt_attribution.json file
This makes it visible also in the overview documentation of the module,
and can be used to automatically generate attribution documents.

The code actually mentions the names and file versions (CVS?) where things
got copied from; however, X11 seems to have stopped using CVS a long time
ago, and without a server it's hard to determine the exact X11 version that
was copied from. It arguably doesn't matter, anyhow, because we won't update
the code anymore.

Fixes: QTBUG-70556
Change-Id: Ib17117a1a3c4112b81982afbd51273048a43221a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-28 13:40:02 +02:00
Tor Arne Vestbø
29b1ac0697 Don't defer platform backingstore creation if we already have a platform window
The creation was made lazy in 18f415e46d, for those platforms (macOS) that
need a platform window to successfully create a platform backingstore. But we
don't need to delay creation if we actually have a platform window at the time
of constructing the QBackingStore.

Change-Id: I6367736ddca82900dec2751a85a8bc35cc742bb5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-24 02:21:59 +02:00
Thiago Macieira
f8d41309c8 Use qsizetype for qt_memfill functions
Just in case the image is larger than 2 GB (512 megapixels).

Change-Id: I343f2beed55440a7ac0bfffd15636cbc68dfa13d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1e2bf51d3e)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-24 01:39:37 +02:00
Marc Mutz
96ff6e8ebe QGuiApplication: drop mutex before emitting fontChanged()
Emitting a signal executes an unknowable amount of code. We shouldn't
hold a mutex while doing so. E.g., if the signal emission causes
another call to QGuiApplication::setFont(), the old code would
deadlock, since applicationFontMutex is not recursive.

Fix by taking a copy of the application font under mutex protection,
then dropping the lock for the emission of the signal.

Change-Id: Ib2569b3a08af6ef5f38459a19f74cb0db27b7772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-23 10:39:43 +02:00
Laszlo Agocs
c47f436175 Avoid double QCache lookup in QOpenGLProgramBinaryCache
Change-Id: I4384a15f0b89e1f6d7f59bff1816fc2e6fc6adfe
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-22 09:40:52 +00:00
Eirik Aavitsland
70e7445dbe Simplify QBezier::addPolygon() implementation
Makes the code a little cleaner, avoiding an issue caused
by UB and/or optimization bug in msvc2019.

Fixes: QTBUG-77119
Fixes: QTBUG-77230
Change-Id: I9bc8f427a90e6fe32b3c26301bbb703a3c4ad846
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-08-19 07:19:28 +00:00
Laszlo Agocs
257bd49c1f Guard with a mutex in QOpenGLProgramBinaryCache where needed
While there is likely no example of it in Qt itself, applications can
use QOpenGLShaderProgram instances on different threads. These instances
have nothing to do with each other but they do share a global cache object.
This becomes problematic without proper synchronization.

Change-Id: I80faf73f34af7e67349eee916bb3f216e22c07fd
Fixes: QTBUG-77469
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-17 16:26:44 +02:00
Eirik Aavitsland
a547404c12 QTextureFileReader: backport ASTC support
Add support for astc format files as an experimental feature.
To enable, configure with "-feature-texture_format_astc_experimental"

(Backported from commit 5a4db421bd94acd12a4ac1f77031996b95f85dbf)

Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-15 09:26:11 +02:00
Laszlo Agocs
3d56572fe7 Include buildAbi() in the shader cache directory name
Task-number: QTBUG-64697
Change-Id: I8b81bce94c50464105a9a43086b06b841e4b8551
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-14 15:03:14 +02:00
Eirik Aavitsland
5322998a0b Limit curve stroking threshold to reasonable range
Avoid unreasonable threshold values for extremely wide pens, since
that can lead to a very high processing cost.

The rare usecases where this would make a noticeable difference will
necessarily also be using scaling, and so is anyway depending on
setting a suitable curve threshold manually.

Fixes: QTBUG-77241
Change-Id: I27cea7d566d144389bb430739fde4f6033c4a28c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-14 10:23:32 +02:00
Morten Johan Sørvig
5d7f113320 Add nullptr guard to QHighDScaling::scaleAndOrigin(QPlatformScreen *)
Commit b6ded193 added an unconditional dereference
of the platformScreen pointer, for calls where nativePostion
is non-nullptr.

Change-Id: I4a6fbbd0337f91d4fcb76c17b4dc60e1b9ad10ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-11 12:01:26 +02:00
Lars Knoll
afb326f071 Refactor lockedAlphaMapForGlyph
Simply return a Glyph pointer and not a QImage to avoid allocating and
deleting lots of d pointers for QImage when drawing text. Saves one
new/delete pair per glyph drawn and speeds up text drawing by 10% for
relatively large glyphs (probably more for smaller ones).

The qtext::paintLayoutToPixmap() benchmark shows a 16% improvement
in performance with this change.

Renamed the method to glyphData().

Change-Id: I7a353de521e4f4321c770fb1ac6043d33f6f332c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-08 11:18:02 +02:00
Eskil Abrahamsen Blomfeldt
a3dec41cf1 Add attribution for AGLFN
We were missing attribution for the AGLFN tables.

Task-number: QTBUG-70968
Change-Id: Ib84cbd25c9f7c49611761c9eba16624de5b77dd2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-08 07:07:37 +02:00
Eskil Abrahamsen Blomfeldt
79e0effead Fix crash in QTextDocument::clearUndoRedoStacks()
When calling QTextDocument::clearUndoRedoStacks() with UndoStack,
there were two bugs: The first was that we were retrieving
the item at "undoState" and deleting this. This is actually the
upper limit of the for loop. If the stack does not contain any
redos, then it would be == undoStack.size() and we would assert.

If there were redos, then we would delete the item at undoState
multiple times (actually undoState times).

In addition, when the loop exited, we first removed the dangling
pointers using remove() and then there was a weird resize() to
the new size minus the old undoState.

This would either assert because we tried to resize to a negative
number, or it would arbitrarily remove items from the stack.

[ChangeLog][QtGui][Text] Fixed a crash bug in
QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack).

Task-number: QTBUG-69546
Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-08-08 07:07:20 +02:00
Laszlo Agocs
53a6f7b783 eglfs: Fix raster windows
Also sanitize the initial WebAssembly hack. Both eglfs and wasm lack the concept
of true raster windows. A QWindow with RasterSurface is rendered with OpenGL
no matter what. The two platforms took two different approaches to work around
the rest of the machinery:

- wasm disabled the QOpenGLContext warning for non-OpenGL QWindows,

- eglfs forced the QWindow surfaceType to OpenGLSurface whenever it was
  originally set to RasterSurface.

Now, the latter breaks since c4e9eabc30, leaving
all raster window applications failing on eglfs, because flush in the backingstore
is now checking the surface type and disallows OpenGLSurface windows. (just like
how QOpenGLContext disallows RasterSurface windows)

To solve all this correctly, introduce a new platform capability,
OpenGLOnRasterSurface, and remove the special handling in the platform plugins.

Change-Id: I7785dfb1c955577bbdccdc14ebaaac5babdec57c
Fixes: QTBUG-77100
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-07 11:46:19 +00:00
Tor Arne Vestbø
455963ce49 macOS: Don't require setting all three color buffer sizes in QSurfaceFormat
Change-Id: Iaa6eb4d64f549a31aa5c53145e8b37facec4ea78
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-02 18:59:24 +02:00
Pavel Artsishevsky
a22bb694ce Fix QPainter's ColorDodge and ColorBurn composition modes
Added checking corner cases (more specific formulas) in
color_dodge_op()/color_dodge_op_rgb64() and color_burn_op()/color_burn_op_rgb64()
to produce correct results for any input.

Task-number: QTBUG-77231
Change-Id: I274f80b356bd4236a9176a84a95604c2eb01787a
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-08-02 12:46:53 +03:00
Friedemann Kleint
174061f9f3 QHighDPI: Fix broken scaling of QPoint(F)
For some reason, the overload resolution of the
High DPI scale() functions introduced by
b6ded193ee chose the
wrong overloads for QPointF and/or QPoint; it fell
back to the generic template intended for qreal,
QSize, etc, ignoring the origin. Remove the
template and spell out all overloads.

Fixes: QTBUG-77255
Change-Id: I5661f16f7326f65156f646f430f5a0c71d5302d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:20:23 +02:00
Michael Brasser
65cdd0f366 Enable shader cache for ES2 when GL_OES_get_program_binary is present
Change-Id: I4fb71471a7dd22441def1eb837857d245c3e3c5a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-07-25 01:49:48 -05:00
Shawn Rutledge
86f91bf0f7 Make the warning in QBackingStore::endPaint() a little more helpful
Amends 2aa9908e24

Change-Id: I2883ca27b06b2b414b4991b2dab3f84100b4c853
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-22 13:09:37 +02:00
Allan Sandfeld Jensen
5c351da046 Protect against integer overflow in painting transformed images
Makes it safe to sample pixel coordinates above 32767.

Fixes: QTBUG-76829
Change-Id: I5965afef1bd65106fcfc130dd37572309eacbe42
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-19 11:55:50 +02:00
Tor Arne Vestbø
e0a486c77d Tie QPlatformOpenGLContext to its QOpenGLContext before initializing
So that the context can be referenced during initialization.

Change-Id: I9ec69b2431ba1ac6256cb2e969a76f515497e247
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-17 09:00:57 +02:00
Eirik Aavitsland
2d597c0e1a QPixmapCache: guard against usage from non-main threads
Depending on the active QPA plugin, QPixmaps may now be created and
used also in non-main threads. But QPixmapCache is not designed to be
used from such threads, so add guards to ignore such access attempts,
both from application code and from Qt library code.

Such unsafe access would often cause a cryptical "~QObject: Timers
cannot be stopped from another thread" warning; that also disappears
with this fix.

[ChangeLog][QtGui][QPixmapCache] Ignore unsafe access from non-main
threads

Task-number: QTBUG-76694
Task-number: QTBUG-72523
Change-Id: Ia2db37e528aec08bfb48808630bdf5e543689039
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 12:43:23 +02:00
Topi Reinio
1e9355fdf2 Doc: Fix incorrect enum value referenced in QImageReader::transformation()
And remove the \c command to enable auto-linking.

Fixes: QTBUG-76878
Change-Id: Ia2352942c7e7040088347becbda07062a9544c98
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2019-07-08 13:22:35 +02:00
Eskil Abrahamsen Blomfeldt
94570dc49a Support pen color in QOpenGLTextureGlyphCache
This is an enabler for supporting pen color for color fonts in
Qt Quick.

Task-number: QTBUG-74761
Change-Id: I3e605f939e6677cbbd4a650ae7998dea8fd2d7a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-05 13:38:14 +00:00
Eskil Abrahamsen Blomfeldt
78caba7ae6 Support pen color with color fonts
Color fonts may also contain regular alphabet characters that
should be rendered with the current pen. In Qt, however, these
characters were drawn into the cache with a default pen color
of black.

Since all characters in a font is currently backed by the same cache,
and it would require a lot of plumbing to get around this, a step
in the right direction is to include the current pen color in the
cache as long as it is an RGB cache. This means that drawing
text with the color font with different pen colors will create
different caches.

There is no API to select font color on Freetype currently, but
this problem has also not been observed there, as the fonts
in question, with both regular and color glyphs, are not being
detected as color fonts (so the text color will be correct).
So Freetype will be left out for now.

[ChangeLog][QtGui][Text] Fixed bug where regular text rendered
with a color font would always display in black.

Task-number: QTBUG-55096
Task-number: QTBUG-74761
Change-Id: Icc7dbf73241db1e7cc6a0de18c2de927aeecf713
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-05 06:02:55 +00:00
Joni Poikelin
d1141b6c90 Fix crash with drag cursor handling
7a7c722782 caused a regresssion in some
cases.

Change-Id: I1089a79534d811b195de663ff664d9ba5a6ac6c5
Fixes: QTBUG-74110
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-28 12:37:16 +02:00
Aleix Pol
cc13b99781 Do not downscale png when the size is exactly right
Don't go through the doScaledRead path (i.e. calling read_image_scaled)
when reading an image that the target size is the image of the file we
are opening.
This makes the loading of the file much faster while keeping the output
correct.

[ChangeLog][QtGui][QImage] Improve loading time when loading png files
that have the same size as the target.

Change-Id: I2a33c49fe1ce52ec296c2175ee542b5bcdec2c4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-06-26 16:21:45 +02:00
Tor Arne Vestbø
44d9e9b096 Fix crash when setting QGuiApplication palette before app is available
Change-Id: Ia154f66a27cba970d179f100e66aa2daab01c9fa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-25 20:08:15 +02:00
Morten Johan Sørvig
b6ded193ee QHighDpi::fromNativePixels: use correct screen
Calls like
	QHighDpi::fromNativePixels(point, window)

would return device independent coordinates outside any
screen in cases where the window is spanning multiple
screens and the native point was not on the main screen.

Correct this by looking up the correct screen and use
its scale factor and origin when scaling coordinates.

Task-number: QTBUG-73231
Change-Id: I01a3a42f42121b8d9f4ced2bb0fb023d6ae6bfe7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-19 15:05:15 +02:00
Thiago Macieira
0e1623158b Fix GCC 9's warning about deprecated violation of Rule of 5
error: implicitly-declared 'QDistanceField& QDistanceField::operator=(const QDistanceField&)' is deprecated [-Werror=deprecated-copy]
note: because 'QDistanceField' has user-provided 'QDistanceField::QDistanceField(const QDistanceField&)'

Change-Id: Ie7ae7616eadf4035bec6fffd15aabc58e99632d9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-06-23 07:03:38 +00:00
Laszlo Agocs
eb144c3c4d Release program when returning from QOpenGLTextureBlitter::create()
Change-Id: I27b9496f9a58ceabc613372463543068cb432bdc
Fixes: QTBUG-60453
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-06-19 12:37:51 +02:00
Friedemann Kleint
6d61b10f65 High DPI: Fix crash in QWindow::mapFromGlobal()
With Web Engine, QQuickWidget or similar, the code can hit on the offscreen
window, when its handle is null. Add a check.

Amends 3af7b27917.

Fixes: QTBUG-76440
Change-Id: I123633d18386efd3dbfb22aad6072e4f0877a62e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-19 08:34:01 +02:00
Frederik Gladhorn
a3e69954f5 Add accessibility notification role
On Linux this role is needed to make desktop notifications work.
There is no equivalent for Windows, iOS or macOS. On these platforms the
role will have no effect.

Fixes: QTBUG-76333
Change-Id: I4ef3b3321f7a0e2c09c1ce432a668428d14c52b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-06-12 10:29:45 +02:00
Richard Moe Gustavsen
084f84d112 QVector3D: fix documentation spelling error
Change-Id: Id3b97ea3ce45452e0b59986bc4fd84fd9b0d3708
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-19 10:25:57 +02:00
Morten Johan Sørvig
7ae2f47214 QHighDpi: Replace fromNative()/toNative() with scale()
We need one scale() function for each type: the scale factor can be
inverted by the caller for the fromNative case. Add a generic
templated implementation which will handle simple types. Add add
specialization functions for compound types that don't have
operator*(), as well as for position types (e.g. QPoint) which account
for the origin.

There's no need for fromNativePixels() and toNativePixels() overloads
for each type; replace with generic implementations which call
scale(). Do the same thing for fromNativeLocalPosition().

Some user code is calling fromNative()/toNative() directly, so leave a
definition of those functions around for now. Also leave a couple of
one-off scaling functions which do not fit the pattern.

Also fix “narrowing conversion scaleFactor to int” warning for the
QMargins scale function.

Change-Id: Ia67accbb670a80dc1747c2e264b97aab75b1251b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-14 19:31:41 +02:00
Eirik Aavitsland
1640973a82 Fix raster paint error in path joins of tightly bending bezier curves
The code for generating round line joins is optimized with a shortcut
for the inner, normally invisible joins.  For certain joins of a
tightly turning bezier, this optimization would lead to visible
painting error. Fix by avoiding the optimization if the next control
point is so close as to allow such tight turns.

As a driveby, make the angle > 90 test cheaper, since absolute
precision is not required in the optimization choice.

Fixes: QTBUG-75008
Change-Id: I293e0776003310dc36fa7f43fbcd9c25f1f8fa5d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-14 11:02:35 +02:00
Lars Knoll
dd5b829468 Raster paint engine: optimize rect clipping
More aggressively skip processing empty spans.
Tested with the qpainter benchmark on armv7; yields
small but measurable improvement.

Change-Id: Ie0ed0f824a0be7bcc2de3a9aa98ebccb0e8accae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-06-11 09:25:55 +00:00
Eirik Aavitsland
3797704c4f Generalize image file name @2x suffix handling to higher scale factors
@3x is in use on iOS already, so extend the handling in QImageReader
to all single-digit factors, like QIcon does.

Fixes: QTBUG-76273
Change-Id: Ic9442731c0549dbe8f797e1ddb1a09d8447e8441
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-06-14 13:08:56 +02:00
Eskil Abrahamsen Blomfeldt
89a25a3ef1 Don't count all engines as "in use" in cache
Back in 36cb3f3f65, we started
properly reference counting font engines as they were entered into
the font cache. Prior to this, ref.load == 0 would mean that the
engine was essentially owned by the cache.

When the change was made, the condition that an engine must be in
use if its reference is != 0 remained, and the result of this was
used to calculate the limit for when the cache should be flushed.

Since this limit was miscalculated, the cache would keep growing,
even if it only contained unused font engines.

[ChangeLog][QtGui][Text] Fixed a bug which could cause the font
cache to grow larger than it was supposed to.

Task-number: QTBUG-76219
Change-Id: I4d1541756f3bdf5bd9b0301bf47c6db2e220716a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-06-09 20:16:55 +02:00
Eirik Aavitsland
a4f79313f0 Fix: QTextDocument::find backward search crossing paragraphs
If the start position of a backward string search was the at the start
of a paragraph, the code would start searching at an illegal position
(at the eol character) in the preceding paragraph. That caused
that whole paragraph to be skipped, so any matches there
would not be found. Fix by making sure the search starts at legal
position.

Fixes: QTBUG-48035
Change-Id: Id6c0159b6613ec75ec617a0a57096ceef2b4cbd0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-06-04 07:14:03 +00:00
Shawn Rutledge
7fc67e09f3 doc: Correct several QEnterEvent accessors
It's cursor position not widget position, pos() is relative
to the widget, and 3 of these accessors return QPointF.
Amends e6ddae07e1.

Task-number: QTBUG-36985
Change-Id: Ide437f7496824f8cdd0d03fa38ad7b573e30feaa
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-06-06 14:49:51 +02:00
Morten Johan Sørvig
1eac947ce2 Work around crash where a destroyed window becomes focus_window
Clear QGuiApplication::focus_window (again) in the
QWindow destructor.

Task-number: QTBUG-75326
Change-Id: Ief00b6adfb267fcc7e3881fd728e12df07fc1094
Reviewed-by: Christian Andersen <csandersen3@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-22 12:08:55 +00:00
Eirik Aavitsland
c04bd30de0 Guard against numerical overflow when processing QPainterPaths
Many operations on and with QPainterPaths do calculations on the path
coordinates, e.g. computing the distance between points, which may cause
numerical overflow for extreme coordinate values. This patch
introduces a limit on the coordinate values and extends the previous
check against nan/inf coordinates to also check against out of range
coordinates.

Fixes: QTBUG-75574
Change-Id: I3a2fa88bfc6a9f19934c43d3dbbfb41855c78107
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-15 13:50:55 +02:00
Ryan Chu
cc4c0b43a5 QDataStream: Fix inconsistent results of iostream with QPalette objects
The value of NColorRoles got changed since 5.11. It introduced one more
role called "PlaceholderText" in the ColorRole enumeration.

When using QDataStream (5.12) to read QPalette objects from a file
written by 5.9 (<5.11), the processing results are inconsistent.

Fixes: QTBUG-74885
Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-05-20 22:33:33 +02:00
Andrew den Exter
d661a22ae2 Write an anchor-type attribute when embedding images in an ODF document
Without this some readers will fail to display the image or position
the image at the start of a paragraph rather than inline.

Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:07 +10:00
Andrew den Exter
345f86a2d8 Avoid re-encoding embedded images when writing an ODF file
If an embedded image is already encodeded as an png or jpg write the
data as is instead of decoding to a QImage and re-encoding as a new
image.

Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:01 +10:00
Morten Johan Sørvig
3386b875dd QHighDpi: Remove fromNativePixels()/toNativePixels() overloads
Replace QWindow / QScreen / QPlatformScreen overloads with template
functions that take a generic context argument.

The API now no longer supports implicit conversions from
QPointer<QWindow> to QWindow *, add explicit data()
call to usage in qxcbdrag.cpp.

Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-22 13:37:39 +02:00