The devicePixelRatio on the returned pixmap should
be the product of the Qt and platform scale factors.
This handles the corner case of setting QT_SCALE_FACTOR
on macOS with a high-dpi display.
Change-Id: I3600165d47c03c4e043bcc5e375932cc3fc0c544
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Assert on receiving double clicks which are currently not implemented.
Task-number: QTBUG-71263
Task-number: QTBUG-70999
Change-Id: I85cd21665ecaf118584053de63745044728d8f5b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When calling setDocument (directly or through the constructor) a delayed
rehighlight is initiated. Previously, if any text was changed before
this rehighlight could run it would cancel the rehighlight, even if the
changed text only caused a new block of text to be highlighted.
Fixes: QTBUG-71307
Change-Id: Ib09b664d90906f5b4427105f0e45469806f3a779
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This check, which was only done once, was wrong:
const int bytes_per_line = ((width * depth + 31) >> 5) << 2;
// sanity check for potential overflows
if (std::numeric_limits<int>::max()/depth < width
If width*height overflows, then it's already UB and checking afterwards
with a division is pointless and slow.
The other instances weren't properly guarding against overflows.
Change-Id: I343f2beed55440a7ac0bfffd1563350d4cfa639c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Also clean up QTextCodec usage in qmake build and some includes
of qtextcodec.h.
Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
These are minor typos or documentation warnings that snuck in with
new features.
Task-number: QTBUG-71502
Change-Id: I03669cfecc3c3d80168ff7b1ca8bca7571e06d25
Reviewed-by: Martin Smith <martin.smith@qt.io>
This part was accidently left disabling after testing the
fallback still worked.
Change-Id: Ic2df939753641a9771e68bc8857c570d356cff44
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The opacity set on a QPainter was being ignored for drawImage()/drawPixmap()
calls when rendering to a PDF file through QPdfWriter/QPrinter. This change
fixes it for PDF files v1.4 (default version) or v1.6. For PDF/A-1b files,
opacity will remain ignored to ensure compliance with the specification.
Task-number: QTBUG-70752
Change-Id: I4280e898698e0367dfb4c6ac2cd14ca2bf98850e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When we try to gracefully destroy a QOpenGLVertexArrayObject it is not
possible to create an QOffscreenSurface from a thread that is not the
GUI thread. In this case we just need to bail out instead.
The side effect that was seen previously was that there would be a
warning and a deadlock on Windows when closing QQuickWindows that
contained a QQuickPaintedItem backed by a FrameBufferObject render
target (which would be using the OpenGL paint engine) when using the
threaded render loop.
Task-number: QTBUG-70148
Change-Id: I4a20d74d9af850bb90d243212ad9f65c3fc9e616
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
If a tooltip was shown on an application modal dialog then it would end
up blocking mouse events to the dialog while the tooltip was visible.
Since tooltips are special in this case, they should not cause mouse
events to be blocked.
Fixes: QTBUG-65599
Change-Id: Ibf1729ca4942f5854e4f9687c5586382e23c1c31
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
There is no sense in testing the 'm_array' pointer against null, as the
memory was allocated using the 'new' operator. The exception will be
generated in the case of memory allocation error.
Task-number: QTBUG-71156
Change-Id: Ib76d16d38d2b0b0c4c9fae3d8d5bdd86af0d08ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt's PDF engine previously supported only the PDF v1.4 standard, which
only allows pages of up to 200x200in (about 5x5m). This patch optionally
enables the generation of PDF v1.6-compliant files that allow the
redefinition of user space units, so that pages of up to 381x381km are
now possible. By default, generated files are compliant to v1.4 spec.
v1.6 compliance must be enabled by, e.g., calling QPrinter::setPdfVersion()
with QPrinter::PdfVersion_1_6. PDF v1.6-compliant files require Adobe
Reader 7.0 or newer (also worked with the built-in viewers in current
versions of Chrome, Firefox and Edge).
Task-number: QTBUG-69386
Change-Id: I21708e0d465d5d7d9e46ff06dd04acfe1dfb0858
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
There is no need to call a memset as long as class is initialized with
new and default-constructor will initialize values.
Change-Id: I02f9ec524e32cb72713f6b5e37b60f3dec72fb28
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
A file with the correct QPicture magic bytes, but shorter than a full
QPicture file header, could cause the header decoder to access memory
out of bounds. Add a size check to avoid.
As a driveby, generally harden the parsing against malformed files.
[ChangeLog][QtGui][QPicture] Fix crash reading malformed picture file
Task-number: QTBUG-71208
Change-Id: I86eb1f915ca9b3a4b91c7433036d76ed6061e2f0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
'description' is used only once in all configure.json files, so
I assume that was meant to be 'purpose'.
Change-Id: I66e9d9196c27d2f2131c2d57ea03895e8f5ce754
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The script taken here is a QChar::Script, not a
QFontDatabase::WritingSystem. This means it was passing QChar::Unknown.
Change-Id: I919ae7187ba277346a7719116a94776dce24dd84
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
According to reports Intel on Windows gets confused when feeding
program binaries retrieved from x86 and x64 builds into each other.
Task-number: QTBUG-64697
Change-Id: Ia7748f532ad06942a92c6fbfc4c9d1ad16bc785a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Before commit 4d15f393a7 update requests
were handled by a timer on QWindow. Therefore they survived the closing
and re-opening of platform windows. Now, as the timer was moved to
QPlatformWindow, it gets reset when you close the QWindow, and any
pending update requests are lost. However, we do set the
updateRequestPending variable on QWindow when requesting an update.
Therefore, we can also restore the update timer on the platform window
when creating it.
Change-Id: I23b00f24a46706beac7d1455edd8a5623db46b22
Fixes: QTBUG-70957
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This was a regression from Qt 4.
Before this patch, we supported filtering events only at QWindowSystemInterface
level, but to properly support filtering in QAbstractEventDispatcher::filterNativeEvent,
we have to filter the events earlier. Now it is possible to enable/disable this
feature for platforms that support native event filtering.
The mapping of which events are user input events were taken from
QWindowSystemInterfacePrivate::EventType.
Task-number: QTBUG-69687
Change-Id: I9a5fb9f999451c47abcdc83fdcc129b5eeb55447
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The pdf engine uses a resource file, but Q_INIT_RESOURCE() was lacking.
Task-number: QTBUG-71070
Change-Id: I685961b3f2eea0ffe6b5313c72d504a8ad9a98e5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We need to override this snippet for the documentation
we generate for Qt for Python, and it is easier to have
it on a separate file.
Task-number: PYSIDE-801
Task-number: PYSIDE-691
Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
QImage's operator>>(QDataStream&) did not set an error mode on the
stream on read failures. That would break QDataStream transactions.
Since the current QImage serialization cannot differentiate between
truncated and corrupted data, we set the ReadPastEnd error as expected
by the transaction system.
Also specify the expected file format on decoding QImage from stream,
to avoid all the format handlers' canRead() being invoked. This is
necessary since some of them may call ungetChar(), which fails when
the stream is in a transaction.
Also add testing of this feature to the QDataStram transaction
autotest. That required a slight rewrite of the fake sequential
QIODevice subclass. The previous implementation had incorrect
behavior of peek(), which is required by QImage decoders.
Task-number: QTBUG-70875
Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes qopenglwindow shader in the triangle
Task-number: QTBUG-67338
Change-Id: I8552183bf9ca45e9b56760b340d014ddd34c21f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Wrong option was used to set zlib compression level for png
setCompression with negative value uses default compression
setCompression with value between 0-100 converts to zlib compression level 0-9
setCompression with positive value overrides Quality option
Change-Id: Ic4b048a1e30d6940019c2a00a6c24d0c11e3f821
Reviewed-by: Alexandra Cherdantseva <neluhus.vagus@gmail.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
When there were additional spaces between the function definition and
the first parameter, the parser failed to parse it when it contained
another function (e.g. 'qlineargradient(... rgb() ...)').
The reason for this was that ::until() needs the function at index-1 so
it can correctly count the opening parenthesis.
Fixes: QTBUG-61795
Change-Id: I992f556e7f8cd45550f83bc90aa8de2b4e905574
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
A few places we didn't check if detach() succeeded including
in reinterpretAsFormat(), where it can be undone.
Task-number: QTBUG-70785
Change-Id: Ibcc8e26e2961f6288eb7a045ae1cb28e59213a49
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
When viewing "Supported HTML Subset" documentation in Qt Creator (in
QTextBrowser), the first table that lists all tags is quite unreadable
(see images). It happens because there is a code snippet in Comment
column for tag "meta" that uses pre-formatted text. Because it should
not be wrapped automatically, it ends up pushing first 2 columns into
their minimum size, which mostly makes them take a single letter per
row.
Task-number: QTBUG-64126
Change-Id: I08bf6f61806d52e7a2f47bdbed1b5950825ce739
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Move the checking logic from QGuiApplicationPrivate::_q_updateFocusObject()
to QInputMethodPrivate::objectAcceptsInputMethod(), which is also called
from QWidget::updateMicroFocus() via QInputMethod::update().
Fixes: QTBUG-56767
Change-Id: Ia4cce5e7e766008df891537048d5daf739c010ff
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Also fix up the docs.
To make everything more complicated, OpenGL ES 3.2 does not support
default tessellation levels. Therefore the related functions remain
OpenGL 4.0+ only.
[ChangeLog][QtGui] QOpenGLShader has been fixed to expose geometry and
tessellation evaluation/control shaders with OpenGL ES 3.2.
Task-number: QTBUG-66074
Change-Id: I2e4277912800d8302824e3fb74f61ec16f4b341d
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
When a QTextCursor survives its QTextDocument, the internal
QTextDocumentPrivate pointer is set to null. There are checks for
this in all the QTextCursor functions to skip out early if such
a QTextCursor is used.
However, when executing the "if (d->priv)" condition in setters,
this will access the non-const operator->() of QSharedDataPointer
and detach the QTextCursorPrivate, and in the copy constructor of
this class, there was an unprotected call into priv->addCursor().
In theory, we could cast all the checks for d->priv to avoid
detaching, but in practice this doesn't matter, since the setters
will typically detach anyway later on.
[ChangeLog][QtGui][Text] Fixed a crash that can happen when calling
a setter on a QTextCursor after its QTextDocument has been deleted.
Task-number: QTBUG-70293
Change-Id: I8f6dc5bb344d1d824f673c0c220b68b7fee237a8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Fixes the rest of the places we use the pattern of emptying the OpenGL
error stack to be able to handle GL_CONTEXT_LOST, and adds a note about
it in the documentation.
Change-Id: I7eb97dbca45f39295b832d44937023b538b19947
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
New API in QMessageDialogOptions and implementation on Android.
Task-number: QTBUG-35545
Change-Id: I59567251199f220862d01ba76979266379eecd86
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Before asking a image format handler to save an image, QImageWriter
sets the value of all supported options. For options like quality and
gamma, the default value is an illegal value (-1 and 0.0 resp.),
effectively telling the handler that the application has not requested
any particular value. But in the case of compressionratio, the default
was 0, a legal value. Fix by changing it to -1.
Change-Id: Iad6d4c2dbe269b25863e7d4967aa9ed2a7d1247f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Initialize the lastDir properly, to avoid the stroking algorithm doing
direction-change handling for a single line. That could cause a cap to
be painted for a single FlatCap line.
Also fixes a bug in tst_qpainter, revealed by the above fix. The
result drawPolyline was erroneously compared to the result of drawing
the lines individually, for a case where the former correctly paints
the pixel of the join point in the corner, while the latter by
coincidence used to paint the same pixel as a cap because of the bug
above.
Task-number: QTBUG-70101
Change-Id: Ie20eda33214cfe9e7627f17ef4c7a5b3835c9c24
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Fixes a speed regression on ARGB32 painting on low end hardware
introduced when it was switched to using the RGB64 raster routines.
It turns out several of our embedded QPA targets use ARGB32 as native
format.
Task-number: QTBUG-69724
Change-Id: I6d7993c12da46a85b8354eb905930dae9602b5e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Stencil is - very likely - cleared just like depth. Also, switch to
STORE_OP_STORE for the multisample buffer, for correctness.
Change-Id: I31b56658286205af8551018115ca2abbe541be67
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Running with QT_VK_FORCE_STAGE_TEX does not work at all with recent
NVIDIA drivers due to QVulkanWindow's and the example's naive way of
picking the memory index. Enhance this and add a warning note to the
QVulkanWindow docs as well.
Change-Id: I7f200e11d982b56e3da3b71ee3915bd7bfca5cc1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
After convert and fetch were split, only convert was still NEON
vectorized, while fetch is the more commonly used version.
Change-Id: Iea2af7ccee6589b3d6e9908afeaae2d1ad2753be
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
As transform() returns worldTransform(), point out that it is an alias
in its description.
Fixes: QTBUG-18117
Change-Id: I0eb1f78c6955b499906024105f9969cdccf13303
Reviewed-by: Martin Smith <martin.smith@qt.io>
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.
Change-Id: I874e04f3b43122d73f8e58c7a5bcc4a741b68264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Instead of doing it up front and then restoring the current context
if the makeCurrent call failed.
By delaying the update, QPlatformOpenGLContext::makeCurrent has the option
to check which context was current before the call.
Change-Id: I458f5c00d7c820acbe2f8552b0513fce99b9b683
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The case of the platform context failing makeCurrent is the exception.
Change-Id: I606e6fb379f84e886bff9e27355dda9b31ff9ebe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Before this fix, QStandardItemModel::itemData returns
a map containing role 255 which is used internally to store the flags.
This role is an undocumented implementation detail so it should
not be returned to the user.
[ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255
Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd
Reviewed-by: David Faure <david.faure@kdab.com>
Applying the transformation in question has no effect on the winding
order. Rewrite that section.
While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).
Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
They were incorrectly attempted to be read as Indexed8, instead use
the RGBA64 formats to read them with full accuracy.
Task-number: QTBUG-45858
Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Snap now uses xdg-desktop-portal for portal support. Add check for apps
running in Snap and make them use portals by default. We also should be
using different name for the platform theme used by sandboxed apps.
Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These fake mouse events should be synthesized by QtGui, not the QPA plugin,
when the tablet/touch events are not handled by the application and the
Qt::AA_SynthesizeMouseForUnhandledTouchEvents or
Qt::AA_SynthesizeMouseForUnhandledTabletEvents flags are set.
Task-number: QTBUG-47007
Task-number: QTBUG-60437
Change-Id: I4d6d5e6667d245c45a4eb4f3a94db05cf9772f52
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Short-cuts the case where there is no gamma correction to avoid a
conversion over RGBA64 and back.
Change-Id: I100697a9f7a4b94283557b2c0eaa45e0eff81785
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is the squashed diff from wip/webassembly to dev.
Done-with: Peng Wu <peng.wu@intopalo.com>
Done-with: Sami Enne <sami.enne@intopalo.com>
Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Started-by: Andrew Knight <andrew.knight@intopalo.com>
Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
When building with warnings are errors for Android with gcc 4.9,
it wrongfully fails on use of uninitialized variable.
Change-Id: I39c5e8413c30567fba60cbba6a8b26d537c5836e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Avoid reading a pixel outside the image even if we multiply the result
by 0. This mirrors a similar old fix in the the 32bit scaling path.
Change-Id: I7860bc808dc46dbc94918672e99c81b56d4a1d27
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Under certain circumstances, if you had a widget with a QOpenGLPaintEngine,
and drew QStaticText into this, and then later had Qt Quick access the same
cache and try to resize it, we would get a crash because the resize function
would have a pointer to the paint engine and try to access its shader manager
(which would now be null, since this is outside the begin()/end() phase of the
paint engine.
The solution is to reset the paint engine pointer to null on the cache once it
has been populated and it is no longer needed.
[ChangeLog][QtGui][Text] Fixed a possible crash when combining QStaticText,
QOpenGLWidget and Qt Quick in the same application.
Task-number: QTBUG-70096
Change-Id: I7383ad7456d1a72499cfcd2da09a5a808d4b3eff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
One trick that is possible to do with QImage is to make it be sub image
of its imagedata by manipulating the data start and bytes-per-line,
we can not upload that directly and need to detect the case and create
a clean copy to upload.
Task-number: QTBUG-70105
Change-Id: I7ce184a0892fb4071b6dcc1a1fd3881a4e0703cd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Do not try using SSSE3 if the compiler do not support it.
(see 648ee7aa02).
Task-number: QTBUG-50804
Change-Id: I489b0bbacfde0c647c9d5b71ca3de992d7dc8878
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
It's possible to use vcpkg using the -I and -L arguments, but
some of their libraries have different names than what we look for
during configure, so add in those variations.
Change-Id: Iee37197228cc0f15442ecd7ec4fc761f4d526e1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Declare rbSwap<QImage::Format_RGBA8888>, so we don't end up in a
fallback definition not used by little-endian.
Task-number: QTBUG-69951
Change-Id: I8512bba76da7d59a27593d37c70283d881c3e8fc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
According to MSDN, AltGr key presses are sent as a
sequence of SYS left Ctrl + right Alt.
Add an option to detect AltGr as modifier key.
Task-number: QTBUG-69317
Change-Id: I30ce169d2e6dbbae194ff714abfbc732b53652ce
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This allows apps that know their icons are
in a given icon theme to set that theme as
fallback, so in case the user theme does
not include them, the icons can still be found.
This solves the problem of missing icons
that often happens when running KDE applications
on a GNOME desktop.
Change-Id: I4e5543d598012352a29ff79dab0357506d986b6d
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QRegularExpression doesn't offer a direct equivalent of QRegExp's exact
match.
There are several places in the Qt sources that use this feature. This
patch implements a small helper function that builds the expression as
recommended in the documentation and updates the related code.
[ChangeLog][Core][Tools] QRegularExpression now provides
anchoredPattern() which is a helper function to build regular
expressions used for exact matching.
Change-Id: Idbbf142c4c5cb9b62abf8229f4ce85fd4409e5d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We detect if there's an upcoming momentum phase using the same trick
used by e.g. Mozilla in their event handling: https://tinyurl.com/yd8lcs4l,
and as recommended by an Apple engineer: https://tinyurl.com/y8yytlgv
The event is not guaranteed to be in the queue, but in practice it seems
to be. If this assumption fails we can add a wait timeout to the event
search instead of using [NSDate distantPast] as a timeout (which only
looks at queued events).
When the momentum phase is detected, QWheelEvent::phase will have the
new ScrollMomentum value, and the phase transitions will be
ScrollBegin -> ScrollUpdate -> ScrollMomentum -> ScrollEnd.
We no longer send ScrollEnd to signify that the user's fingers have
been lifted off the trackpad; rather, the first event with ScrollMomentum
phase means that the fingers have been lifted and macOS is now sending
simulated-momentum events.
This means ScrollEnd is a reliable indicator that the entire scroll
gesture (both the user interaction and the momentum) has ended.
If the ScrollMomentum phase is skipped, it means the user's fingers
came to rest before being lifted, so there is no momentum. In that case
the transitions will be ScrollBegin -> ScrollUpdate -> ScrollEnd.
Task-number: QTBUG-63026
Task-number: QTBUG-65160
Change-Id: I80191a472f6fa892387004c199166a6350124274
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Fixes a regression introduced with the update to the bidi
algorithm.
Task-number: QTBUG-69633
Change-Id: I7eac45ed3ffb41f89ea3f793eedcfb6fcdace871
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Don't show the mark simply because we have unicode code points
larger than 0x590.
Task-number: QTBUG-69665
Change-Id: I9af97383f3bcd52277a5288e7ad06ec240c7e51c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
After the behavior of setItemData has been changed following QTBUG-45114,
QStandardItemModel was lacking an interface to clear all the data from a single index.
Task-number: QTBUG-69616
Change-Id: Ide0b5bb6358439fc42c474df8b044fbace6def8d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.
Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
When glGetError returns GL_CONTEXT_LOST, on XCB + Nvidia at least, the
error does not get cleared until the next successful
glGetGraphicsResetStatus.
We can't handle this properly until the start of the next frame where we
will hopefully have a valid context, but in the meantime we should avoid
locking up completely.
Change-Id: Id438d44d83b926e1f3e4281ca3704231bf1a23cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Id0118e44e1ed44fecdd803dbc57ca0588a1afec0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We now include the phase, which is helpful, and we distinguish between
modern wheel events with a pixel and/or angle delta, and compatibility
events sent from QWindowSystemInterface::handleWheelEvent with the old
Qt 4 single value delta and orientation.
Change-Id: I2efe9fe7a55c43240ec94bfa70cafaac6d52603c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Expands the existing conversions for ARGB32<->RGB30 to also handle
RGBA8888 to avoid any performance regression of the 16bpc conversion
path.
Change-Id: I34e519a04276b0e7ff00c6125ba06c889045d2ac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
While the property is deprecated, we should still set it, even in the
legacy free constructor. The window system never sends x and y changes
at the same time, so either coordinate will be null, therefor add them.
This should restore the old behavior.
Task-number: QTBUG-69089
Change-Id: Ie329cb4196f53c70b25934cbbac5e2e48c65d2b3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This update corrects several minor documentation errors that
cause qdoc warnings. These include incorrect or missing \fn
commands, incorrect uses of \e and \a commands together,
incorrect spellings, etc.
Change-Id: Ib26edef541fa3440025490bcf79cc101623e7f7b
Reviewed-by: Martin Smith <martin.smith@qt.io>
On macOS we pull out all the modifiers up front, which in the case
of incomplete key sequences such as "Meta+Shift+" will result in
an empty string as a result. The cross-platform code does not
handle that case, so we need to exit early.
This fixes an assert in tst_QKeySequence::parseString().
An assert has been added to QKeySequencePrivate::decodeString()
to make the assumption about the 'accel' argument explicit.
Change-Id: I135e62f9051a8b899202e5fb224b5d3c77bf2062
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Adds support for 16bit per color image formats in QImage. This makes it
possible to read and write 16bpc PNGs, and take full advantage of the
16bpc paint engine.
[ChangeLog][QtGui][QImage] QImage now supports 64bit image formats with
16 bits per color channel, compatible with 16bpc PNG or RGBA16 OpenGL
formats.
Task-number: QTBUG-45858
Change-Id: Icd28bd5868a6efcf65cb5bd56031d42941e04099
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When showing line and paragraph separators at an offset from the start
of the string, the end of string pointer would be incorrectly set, and
we would read past the end of the string. If any part of this memory
happened to match the line or paragraph separator, then we would
overwrite it and have a crash.
I couldn't find any reliable way to test this, since the crash depends on
the contents of the memory after the string allocated by the algorithm.
But with an overflow of 100 000 characters, I found that it crashed every
time I ran the test.
[ChangeLog][QtGui][Text] Fixed potential crash when using
QTextOption::ShowLineAndParagraphSeparators.
Task-number: QTBUG-69661
Change-Id: I17d1996b883560bacdc7ce114c8aeb2b0108faea
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Michal Lazo <xlazom00@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Off-by-one bug in the validity test of the texture type field.
Change-Id: I46ded85a0ad93166aa886e71f0c391f27e79f64f
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Need to include <QSize> for operator<<(QDebug, const QSize &).
Change-Id: I4857e9b43918243af66cc09ff352619595c081c9
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
I could have placed the class in an unnamed namespace. That would
mark the member function as a local symbol too. But I preferred to
move outside so I could make it static.
Change-Id: Ie01831ddac5446fdbdeefffd154688c0883ed653
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Unnamed namespaces and static are great tools. Use them.
Change-Id: Ie01831ddac5446fdbdeefffd15468b3acb3ced79
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Returns an ARGB32_Premultiplied image when the framebuffer
is grabbed on a transparent QOpenGLWidget or QOpenGLWindow.
Task-number: QTBUG-55245
Change-Id: I4b7778ecc38275be1ed9fb748c77c7e1f6b65a00
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The platform may emit screen changes for child windows before top-level
windows, so we need to update the top level screen as soon as possible.
Change-Id: I090c620725c9c3171f5b038708d78ddfeec8512d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A typo meant the color-table was not fixed. For safety fallback colors
are also made opaque.
Change-Id: I3e609882177604910c4343c86f00221a89af9078
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The fast image blending is only used for SourceOver composition, but
several of our embedded backends make heavy use of Source composition
which doesn't have a short-cut. This patch adds a blitting short cut
that works in those cases.
Task-number: QTBUG-69724
Change-Id: Icc61a67cc27bc83863153d69cae60dd986d26f69
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The rest of the RGB64 routines were optimized, but the loading of RGB32
was not as it was originally not used much, but with ARGB32 using the
RGB64 backend, it is essential for decent performance.
Task-number: QTBUG-69724
Change-Id: I1c02411ed29d3d993427afde44dfa83689d117e0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The ppm format specifies that the maximum color value field must be
less than 65536. The handler did not enforce this, leading to
potentional overflow when the value was used in 16 bits context.
Task-number: QTBUG-69449
Change-Id: Iea7a7e0f8953ec1ea8571e215687d12a9d77e11c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use platform window directly for setting a mask to prevent bitmap
scaling if pixmap and window DPR are the same.
Amends: 42f788ffe2
Task-number: QTBUG-61948
Change-Id: I5eec85c01f20bdefff7343e83ff10cbcb2c79508
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Using QTextCursor::Left and QTextCursor::Right moves the cursor visually to right or
left, which does not work with Right to left text, where moving left means advancing to
the next character, and vice versa.
By using QTextCursor::PreviousCharacter and QTextCursor::NextCharacter we leave it up to
the engine for deciding where to move depending on the context.
Task-number: QTBUG-50619
Change-Id: Ibf0a886f3ff6bf9ca2c953aeff8c235612bbc01d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The emulation was not working since the vertices are clamped before
getting to the fragment shader. So instead just resize the brush if
not supported.
Change-Id: I856e47890cd3021874b77d869a6ff7162cadde10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Turns out on OpenGL ES, only the GL_RGB10_A2 form is allowed as a
render buffer storage format.
Change-Id: I42915b61835167ae457aae91da7e75065dd3eb21
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This way the logic can be reused elsewhere.
At the same time a standard OpenGL ES/3 way of handling BGRA is added,
so we don't depend on extensions, and handling of NPOT and max size
which QSGTexture will need.
Change-Id: I475bc7127f44be3964fdb482c9e86a20db1fbca5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The ascending variable was a leftover from an old implementation. Now
it's not needed anymore. It's safe to remove it, and the condition can
be removed as well.
Amends commit 699e8fe3a6
Coverity-Id: 11004
Change-Id: I003b7016e9bd3bd523fb70ed4de84211ec840a78
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
In an unrelated change, it seems \internal \obsolete
can cause unexpected behavior when generating the
documentation. Adding this line break should fix that.
Change-Id: I95eceb109faaf89be8f258fba8c31008fdc4ca57
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Add a framework for reading and decoding stored graphical texture file
formats. Includes decoders for the PKM and KTX formats.
This is basically the same texture file reading that was added to
qtdeclarative for 5.11, but has been refactored to be independent of
the scenegraph and opengl.
Task-number: QTBUG-67026
Change-Id: I87d8117550d8a2112f4f58c03e9ac6b3249cbc5a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
ObjectBoundingMode has inconsistent behavior and is deprecated in
favor of ObjectMode.
Change-Id: I748f6283f3db5869bb9a67c08bf5f16abc6f95b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Now all files that use QInternalMimeData include
qinternalmimedata_p.h, and we can remove the transitioning include
from qdnd_p.h
Change-Id: I6c86cb6a5bd73076e5dd3bafc01861b75ab83845
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
So if people are using the -Wzero-as-null-pointer-constant don't get a warning when using these private QPA includes
Change-Id: I6deb089b17a844680db24998d60c94de7a1227b1
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
this puts the actually relevant includes into the correct field, which
potentially allows early header resolution, and is generally just
cleaner.
Change-Id: I9db870442d22a329441eafe53098d18cdc91ce16
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Having the helpers in each respective module lets us implement the
helpers using private APIs without forcing the test to add private
dependencies.
It also makes it easier to test Qt using a third party testing
framework (for running the test suite), while still using the helpers
for ensuring tests behave expectedly.
Change-Id: I2a6ce24526ed345f3513548f11da05c7804c203f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
A bit depth 1 png image may contain a single color table item. The png
handler would in such cases reduce the size of the QImage color table
to 1, which could easily lead to crashes later on.
Task-number: QTBUG-69256
Change-Id: I01d78977c121bacc44b823231d8f32ca63d8a98c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The copyright year of the qgrayraster.c dependency was incorrectly set
to “2006-2015”, instead of 2000-2016 (as stated in the file’s header
comments). This commit solves this issue.
Task-number: QTBUG-69261
Change-Id: I307b6eabdd133fe4f8371b963577b59af8620838
Reviewed-by: hjk <hjk@qt.io>
As the comment says, Haswell is a nice divider and is a good
optimization target.
I'm using -march=core-avx2 instead of -march=haswell because the latter
form was only added to GCC 4.9 but we still support 4.7 and that has
support for AVX2.
This commit changes the AVX2-optimized code in QtGui to Haswell-
optimized instead. That means, for example, that qdrawhelper_avx2.cpp
can now use the FMA instructions.
Change-Id: If025d476890745368955fffd153129c1716ba006
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Items in the cache may be part of the parent/child hierarchy. Make sure
not to have dangling pointers in the cache, but rather cleanly remove
all interfaces that get deleted since they may delete each other (TabBar
deletes its child interfaces for example.
Task-number: QTBUG-69283
Change-Id: Iad17cd1d3356804b3d8cbba8632ec22b836c3521
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Input value which is over the highest acceptable value, but consisting
of a number of digits equal to or less than the max value should be
considered intermediate.
[ChangeLog][QtGui][QIntValidator] Input value with over the highest
acceptable value, but with equal or less amount of digits than the maximum
value is now considered intermediate.
Task-number: QTBUG-59650
Change-Id: I71a77c9c266f0f3b62c71ac6cb995019385c1cf5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Use CamelCase, like the API they're tracing.
Change-Id: Ie718ab624d17c9186bcf05cc1276c8eccad7f454
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
For performance, the triangulation of a painter path is stored for
reuse. Re-triangulation was only done if the path was to be painted at
a significantly different scale AND it contained a curve (bezier)
element. But also the triangulation of a path with only straight lines
can lose precision if rendered at a small scale, and so look bad when
used at a higher scale factor.
Fix by removing the mentioned curve element condition.
Task-number: QTBUG-68873
Change-Id: Id3492514e9382a5828377b7bafea8cfac7b850a6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
If you clicked to the right of a text line ended with a grapheme consisting of
several characters, either because it was a unicode surrogate pair or a ligature,
we would always to the previous character in logical order, without checking
if this was a valid cursor position.
One result of this would be that hitting backspace when the cursor was positioned
in an invalid position, would cause the entire contents of the document to
become invalid.
Instead we should search backwards for the previous grapheme boundary using
QTextEngine::previousLogicalPosition().
[ChangeLog][QtGui][Text] Fixed position of text cursor set by clicking outside
the bounds of a text line that ends with a surrogate pair or ligature.
Task-number: QTBUG-69085
Change-Id: I7224c065f332f398bdfbb3f42b2b3ec8280c76a4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Some of the gradients from https://webgradients.com/ are not minified
completely, so we need to be a bit more lenient when converting them
to the internal format used by QGradient.
Change-Id: I47466b6a77abd6d2fefc1326fbf6ba5713dd74cb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Instead of caching the last index of a search for a child item, cache
the index of the child in the child item. When the item model is not
changed, the index is valid. Otherwise, the index can only change when
items get inserted or removed before the child. So in that case, start
searching in the vicinity of the previously known index.
As an example: a selectAll() on the view will always hit the cached
index, so no search is performed for any item in the model/view.
Task-number: QTBUG-61368
Change-Id: I85d085299987237fae23451d9e8bbb6060464ef2
Reviewed-by: David Faure <david.faure@kdab.com>
Previously, the search for the index of a child was done by searching
forwards (minus 2) from the last search, and subsequently backwards when
it wasn't found. This would cause quite some searching in models with
lots of items, and where the child lay before the last search.
We still assume that subsequent searches for children are "nearby" the
previous search, but instead of first searching forwards and then
backwards, do the search in both directions.
Task-number: QTBUG-61368
Change-Id: Idb549c2d02840632cd658f906816ce911f3ff8bc
Reviewed-by: David Faure <david.faure@kdab.com>
The recently merged f5fe9fc5a4 (Add ObjectMode to QGradient) changed
combineXForm() to check the brush's gradient's
coordinatemode. However, combineXForm() is now also used when painting
with high-dpr image brush. In the latter case, the gradient is 0 so
this would crash. Testcase: tst_lancelot, image_dpr.qps.
Change-Id: I5e2785ef708768c3fa3eac0999c9c24fd25108f4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This was a regression from Qt4 and also is the documented behavior.
In addition this patch fixes various issues with cursor shape updating
that were discovered along the way and that are necessary for testing
the new changes.
The code in QGuiApplicationPrivate::processDrag() also needed a fixup,
particularly the resetting of QGuiApplicationPrivate::currentDragWindow.
Without this fix we would get DragMove (the one that immediately follows
the DragEnter) only for the first DragEnter event. For example when dnd
starts on mouse press then for mouse click we would get:
<click> DragEnter->DragMove->DragLeave <click> DragEnter->DragLeave
but the expected is:
<click> DragEnter->DragMove->DragLeave <click> DragEnter->DragMove->DragLeave
Task-number: QTBUG-34331
Change-Id: I3cc96c87d1fd5d1342c7f6c9438802ab30076e9e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Fix spurious comma added in commit c4a21708ed.
Change-Id: I6d62378dfdda7a0da611eed1064cff707b9c6bf6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Need to do the same for startsWith() and endsWith(). indexOf() is a lot
harder.
[ChangeLog][QtCore][QByteArray] Added compare(), which takes
Qt::CaseSensitivity as one of the parameters. This function is more
efficient than using toLower() or toUpper() and then comparing.
Change-Id: Ib48364abee9f464c96c6fffd152e69bde4194df7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The ObjectBoundingMode coordinate mode of QGradient allows specifying
the gradient coordinates relative to the object being painted. But if
the gradient brush also has a transformation, that transformation is
applied in the logical, not object, coordinate space. That behavior is
counterintuitive. However, changing it now would break existing
code. Instead, we introduce a new coordinate mode enum with the
expected behavior, and document the old one as deprecated.
This prepares to fix the bugs below in qtsvg, by making
it possible to specify the same behavior in Qt as SVG has.
[ChangeLog][QtGui][QGradient] Add ObjectMode coordinate mode
[ChangeLog][Important Behavior Changes] QDataStream version bumped up to 18 to account for changes in the serialization of QGradient.
Task-number: QTBUG-59978
Task-number: QTBUG-67995
Change-Id: I8820a2555359812f3e1a46e37d6ac2cc29a2091d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The order of the arguments of QHashCombine::operator() was
accidentally swapped -- the first is supposed to be the
accumlated value, the second the new value to combine.
[ChangeLog][QtGui][QMatrix] The qHash() implementation for
QMatrix has been changed.
[ChangeLog][QtGui][QTransform] The qHash() implementation for
QTransform has been changed.
Change-Id: Iba13f76ff734a2184c96184ee0e5748c05db07fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
the json format uses single strings for library sources, as that leads
to less noisy source text. however, this implies the need for de-quoting
and subsequent re-quoting whenever the values are processed. so change
the internal representation to regular qmake string lists as the first
thing when processing the lib source, and re-quote only when outputting
the values.
CFLAGS are excluded, because we'll deal with them differently.
Change-Id: I4ab43d98085ea9f6601fd21ac2afb5bce4f7e2a9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
All the other highdpi scaling uses rounding, and not using it here may
offset the compositing by a line.
Task-number: QTBUG-67994
Change-Id: I2f5f328c091d0e85c40b1663e22c82f364df65e5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Optimize the general transformed fetcher and use it to replace several
specialized copies of it that are now slower than the general one.
Change-Id: Ife79ec99227f0df4f127303c7a340b2f7d174dff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Adjust line positions to deal with negative leading which isn't included
in height of QTextLine.
Change-Id: Id7918968c0f9d7e65700b9e7a08fc5d761883f22
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The PDF backend was ignoring the cosmetic attribute for certain pens,
resulting in strokes rendered incorrectly.
Task-number: QTBUG-68537
Change-Id: Ib9fd5a510716056c8afe67733f51fc682bbb7354
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
If the fbo had samples > 0 set, it would use a temporary fbo with
a default configuration losing the HDR precision.
Change-Id: I7e9966165b3100f148c4ad24738f3ee71273f29a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The implementation of QTransform::transposed() had a wrong assumption
about the type of the result.
Task-number: QTBUG-68630
Change-Id: Ia5ce794efe773d74fb5fdaff3da8cae2b452e7e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
[ChangeLog][Wayland] In Qt 5.11.0, support for selecting a platform plugin based
on the XDG_SESSION_TYPE environment variable was added. On gnome-shell, however,
bugs—in both Qt and gnome-shell—made many widget applications almost unusable.
So until those bugs are fixed XDG_SESSION_TYPE=wayland is now ignored on
gnome-shell.
Task-number: QTBUG-68619
Change-Id: I902acd1c4fc996f46e8431c12c0a5cdbab883abf
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qdoc didn't handle this. This update fixes most of what was wrong,
but tuning the details of the namespace reference pages might follw.
We have namespace Qt as an exaqmple. Most of the elements in the Qt
namespace are in QtCore, but a few functions are declared in QtGui.
Before this update, qdoc used the hack of using #ifdef to remove the
declarations from qtextdocument.h in QtGui and .cpp and then added
them back into qtnamespace.h and .cpp in QtCore.
Now that hack is no longer necessary. The functions in the Qt namespace
that are declared in QtGui are documented there, but the documentation
is linked to from the namespace reference page, which remains in QtCore.
That is, only one \namespace command is used to document the Qt namespace,
and it appears in qnamespace.qdoc where it always did, but the documentation
for the Qt namespace functions declared in QtGui is now appears in
qtextdocument.cpp where it belongs.
Change-Id: Ic5888875c3b8310a3dba244475e2a6c3bc0c1808
Task-number: QTBUG-67267
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Similar to Qt::GlobalColor, the presets allow the user to create
brushes based on predefined gradients, quickly getting pretty pixels
on screen.
The presets are based on the linear gradients from WebGradients, a
free collection of gradients, hosted at https://webgradients.com/.
The few radial and blended gradient presets have been excluded.
Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The change to fix 16-bit integer overflow used two floor operations
when only one is necessary. With floor being rather expensive on x86
without SSE4.1 this caused a performance regression in ARGB32
smooth perspective transforms.
This eliminates one of the floor operations which is unnecessary as the
number is always positive in this case and thus truncation will yield
the same result faster.
Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.
Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
When multiplying a float in [0;1[ with (1<<16), with rounding, it might
end up being rounded to 65536 even if the input was under 1. This patch
uses a floor operation to make sure the value can be in a ushort, and
cleans up the surrounding code so it is clearer what it does.
Task-number: QTBUG-68360
Change-Id: I2d566586765db3d68e8e7e5fb2fd1df20dabd922
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The bounding rect was not including positive leading of the last line. This
patch solves it by changing using QTextLine's setLeadingIncluded, and adds
handling of negative leading to keep rendering unchanged in that case.
Change-Id: I4d18b81892184bb85cd7949a5dc3fb9cfa270a26
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
After the merger of fetch and convert, we were missing the hook
to the accelerated merged version of ARGB32->ARGB32PM conversion,
causing a minor performance regression.
Change-Id: I3965d1a95f2305306005db09640f2775aa645d2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace the XML pages which are typically displayed as broken
by the XTHML pages. Strip some suffixes.
Change-Id: Idf2b9706f169484c659582a1a2d38904d5dd81aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QImage::transformed() can sometimes return an image with a different
image format than the original. This might be unexpected, so explain
it in the doc.
Task-number: QTBUG-50087
Change-Id: I165fc7b44439b770b542be52d3108fd70bf0ae99
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Add API to activate previously added Metal layer implementation.
This provides minimal support, and unlike VulkanSurface
there is no separate QWindow subclass.
What this does do is configure the QWindow to use a
Metal layer, and to send expose/update events when
the layer content should be redrawn. Qt will also update
the layer’s drawableSize and contentsScale when needed.
Application code can make use of this by accessing
the QWindow layer, which will be a CAMetalLayer:
CAMetalLayer *metalLayer = reinterpret_cast<CAMetalLayer *>(
reinterpret_cast<NSView *>(window->winId()).layer);
Change-Id: I514f5186133c3e610fd4e53ca91fe9c85c6d016e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This reverts commit 0b815aa2f8.
Inter-module compile issues have been resolved now, see
qtwayland/44f3b888a3f88ac8097ff65aec0101dbe6a369ef.
Change-Id: I7f9ed4f9d5f0d6431493a8f47ffe8a85141f0e50
Reviewed-by: Liang Qi <liang.qi@qt.io>
Task-number: QTBUG-67777
Change-Id: I6d52b650fb33283010ef06259da83cdb2fd3483f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
... that were removed in 10b3286313.
This is needed so we can properly resolved inter module
dependencies (update qtwayland to use the new API).
Task-number: QTBUG-68151
Change-Id: If9c3b42f76bd2c1d8fc86304cfcc22c18bad9e27
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
We already have better optimized versions in drawhelper. Removing
these versions is a performance gain.
Change-Id: I431c74e440529648d9bc5e22c0e700a72d376934
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Use 16-bit multiplication as it is twice as fast as 32-bit
multiplication.
Change-Id: I64b529eaaed4ce2c59c64a0120e93cd132724156
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is useful to see why shortcuts (in Qt Widgets and Qt Quick) are
not behaving as expected. For example:
The following shortcuts are about to be activated ambiguously:
- QKeySequence("Esc") (belonging to QQuickShortcut(0x7fcd4c8e6a70,
name = "exploreViewBackOrCloseShortcut"))
- QKeySequence("Esc") (belonging to QQuickPopupItem(0x7fcd4c8e5110))
Change-Id: Id20a3017d69cfe417c2286dccf46b3d5ff0b31b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
They were slower than the long path version due to working too hard.
This also unduplicates code by using the blend_pixel function.
Change-Id: Ibf84b8f749cf40d4c852b459dc76860afd850d32
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
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>
... instead of using a hack of directly accessing QGuiApplication
members.
The current QPA API was bad for two reasons:
1) It expects platform plugin authors to know about
internals of Qt Gui, particularly that QGuiApplication
uses QGuiApplication::{mouseButtons,keyboardModifiers}
to construct QDragMoveEvent and QDropEvent events. Which
results in the second reason why this is bad.
2) Platform plugins should not directly access member
variables of QGuiApplication, just to make sure that
QDragMoveEvent and QDropEvent events contain correct state.
Platform plugins should instead use QWindowSystemInterface
to communicate with Qt Gui (which is also the solution here).
The solution is to extend QWindowSystemInterface::handle{Drag,Drop}
to require mouse/keyboard state. We already do this for
some of the other methods, so it is nothing extraordinary.
This type of interface is also _required_ to support
drag-n-drops from other processes. We can't use
QGuiApplication::{mouseButtons,keyboardModifiers} when the
drag originates from another process, instead we need to
query mouse/keyboard state from the system.
This patch fixes drag-n-drops from others processes on XCB
platform plugin.
Task-number: QTBUG-57168
Change-Id: I3f8b0d2f76e9a32ae157622fef801829d629921d
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
Add QPlatformMenuBar::parentWindow(). Since we call handleReparent()
every so often, it's reasonable to be able to get its value back.
While this parent window won't give us much information from
the point of view of the actual QWidget parent for the menubar,
the main reason we will need this is to check for modality blockage.
Indeed, QApplicationPrivate::tryModalHelper() only cares about the
widget's window since modality blockage is decided at the window level.
Change-Id: Ie79f483424b01e430bc9168ba82489e30d15aec6
Task-number: QTBUG-67938
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Avoids using an intermediate buffer on store and simplifies the code.
Change-Id: I2dc4e735eb770f90dc99fe0f513b4df3b35ee793
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Modifier keys are saved in qinputdevicemanager such way that both evdev
and libinput can use it the same way, it is also handling the repeating
modifier key events. Evdev support is important for VxWorks support
because it is using it.
Task-number: QTBUG-60694
Change-Id: I49038cb7fe2ad5134b3a37167c19953867ea31c3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@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>
A <br> has a new-line but no text, so be able to handle no lines.
Task-number: QTBUG-60853
Change-Id: I3d4dbd529114bbe8afe760c3622b52446202ec7c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The NEON implementation uses rsqrt and thus can not be taken on 0, so
replace the minimum with something close to zero instead of zero.
Task-number: QTBUG-59961
Change-Id: Ia39e45be675b056c1e22900495ce9ba4e8b70e5f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This patch enhances QTextImageFormat with a property for image quality.
Default will be quality of 100. The user may set different values with
setQuality(int). QTextODFexport will export images as png if quality is
set to 100 and as jpg with the compression quality set to the given value
if smaller than 100.
[ChangeLog][QtGui][QTextImageFormat] Adds two new functions to the class:
setQuality(int=100) and quality(). Is currently used by QTextODFWriter to
determine the image type and quality when exporting images to ODT files.
Change-Id: Iaa8ec0246aaba004d98c9e8c66609795101519a9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The documentation states that if you have a range of
0.00-2.00 with the number of decimals set to 2 then
any number up to 9.99 would be considered intermediate.
This is because the number of digits still matches both before
and after the decimal point. If it is 10.0 or 9.999 then
it is still considered invalid.
In the case of 9.999 being invalid in this case, the documentation
is corrected as this was incorrectly indicated as Intermediate,
as the code indicates it as Invalid.
Change-Id: I07b433e856f355916a1240deafdf4ef58e680639
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
So that platform plugins don't need to dive into QWindowPrivate.
Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The output routine used a fixed size scratch buffer, with no attempt
to handle overrun. Add a simple fallback code path for such (extremely
rare) cases.
Task-number: QTBUG-66788
Change-Id: I52531b829baeaa48a8fb5a637a020ee9f89d270a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This static method can be called before QGuiApplication is created. At
that point there is yet no primary screen, so the implementation
needs to guard against dereferencing a nullptr.
Task-number: QTBUG-67309
Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QTextDocumentWriter only supports a small subset of table formatting
when exporting to ODF-format. This patch adds more formatting
capabilities to the ODF exporter:
- table border support
- table alignment
- table width
- respect column constraints (column widths)
- add a tab before soft line breaks. This will avoid causing the last
line to stretch all over the cell in justified paragraphs.
With this patch, line height settings are now exported, too.
[ChangeLog][QtGui][QDocumentWriter] QDocumentWriter now supports table
borders, table alignment, table width, column widths, line height and
image resolution when exporting QTextDocuments to ODF files.
Task-number: QTBUG-63581
Change-Id: I2d269ef0f842e73af64d48bfef531d5fa3078088
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
With SSE2 or NEON interpolate_4_pixels is faster than
interpolate_4_pixels_16, and using it saves a branch of duplicated code.
Similar changes had already been done other places it was used, those
have been updated to follow a similar logic.
Change-Id: I040d96480f7f925f659602f66f931d28b59312a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
BuiltIn inputs shouldnt be translated into a code input. We comment the
input line for this variables
Change-Id: I3b7d2fd06afc6a122d90a999fc5a5246fc93234e
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
the option is a quad enum, with "yes" meaning "either system or qt". the
distinction is made only in the "system-xcb" feature, while "xcb" itself
must be forced on in the "yes" case.
Task-number: QTBUG-67251
Change-Id: Ib706e79a902ae0f1b64ca6d4611c9214b7b7e928
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
The cost for the pixmap cache was calculated in bytes but
setCacheLimit() takes the size in kilobytes. This lead to the
situation that all values above 2097152 overflowed and disabled
the caching completely. Fix it by calculating the cost in
kilobytes as it is done in QGLContext.
Task-number: QTBUG-45293
Change-Id: Ib8dc2360c8f3201ce0b615a04c38b5ccaa8fc6cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Add functions for converting QImage to HBITMAP and back
supporting additional formats of QImage (RGB888, RGB555,
Indexed8 and Mono). Add test with roundtrip to tst_qimage similar
to tst_QPixmap::toWinHBITMAP().
Task-number: QTBUG-51124
Change-Id: Ib568898e7162686bfa527d828785628eb0b78e21
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
On platforms where integer by default is int32(max is 2147483647) and
(1 << 31) will be 2147483648
Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The OpenGL wrap mode defaults to GL_REPEAT although it is not supported for
non-power-of-two textures on hardware that only has limited support.
I.e. the following would create a texture with an invalid wrap mode:
auto *t = new QOpenGLTexture(QOpenGLTexture::Target2D);
t.setSize(123, 456);
This patch adds a check in QOpenGLWindow::setSize to see if it's called with a
non-power-of-two size on hardware without full support, and if so sets wrapMode
to ClampToEdge (which should work on devices with limited support).
Task-number: QTBUG-67418
Change-Id: I56e9f4383dbf5430c2bc5e4e9e585712b3603c13
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
If a file link to a html file has a fragment part included then this
will be lost when passed to QDesktopServices::openUrl() as this is not
kept in the conversion of the QUrl. So by checking the filename in the
case of a fragment existing in the url, we can be sure that the
information is passed on correctly for html files.
Task-number: QTBUG-14460
Change-Id: I8167d8c164713dd999603ba9e74150f4f1a4abea
Reviewed-by: David Faure <david.faure@kdab.com>