The naïve approach used for layer-backing in the past caused a detach
of the backingstore QImage on each beginPaint, since the image was
assigned to the layer via a CGImageRef that participated in the
QImage implicit sharing (and had to, so we couldn't get around that).
We now use IOSurfaces, wrapped in a QPlatformGraphicsBuffer abstraction.
The surfaces can be assigned to the layer's content the same way images
could, but allows us to reason more closely about whether or a buffer
is in use, and increases the chance that we will have a zero-copy path
to the screen.
Unless the window has requested a surface format with single buffering
we use a dynamic swap chain of buffers. In most situations there will
be two buffers in play, one assigned to the layer and one ready to
paint to, but during resize and some other situations the buffers
will grow temporarily to accommodate the increased back-pressure.
Since QBackingStore is documented as having single-buffer behavior,
we take care to persist content between the buffers before every
swap. By doing this before swapping, instead of before each paint,
we can avoid preserving areas that will be painted to anyways, and
will in many situations (such as blinking cursors e.g.) end up not
persisting anything.
The RasterGL surface case is handled by reading out the buffer data
and doing a manual texture upload. In the future we can support
direct texture access via CGLTexImageIOSurface2D, but this requires
QPlatformBackingStore::composeAndFlush to learn how to support other
targets than GL_TEXTURE_2D, as CGLTexImageIOSurface2D only works with
GL_TEXTURE_RECTANGLE_ARB targets.
Fixes: QTBUG-48763
Fixes: QTBUG-72360
Fixes: QTBUG-71162
Change-Id: Ica12f69b244e54d0fd31c929730d15657c286af8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
FBOs cannot be shared. Streamline the remainder of the sentence.
Change-Id: I654b23f86f4ee4ea2ca8e71958464d9f55394297
Reviewed-by: Martin Smith <martin.smith@qt.io>
Since 5.12.1 the library name provided is an absolute path. We need to
take the case into account, otherwise it just fails to build if the
target is used.
Fixes QTBUG-72903
Change-Id: I96407e5fe1831487da77cbe7b24b64dae59b22ff
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Otherwise we can end up in an infinite loop of splitting the curve and
then discarding the half of the new curve, etc.
Fixes: QTBUG-74172
Change-Id: I1984b7fd33cd98f65866f1c57c6ab20114615803
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The older BGRA extension is more likely to have stable driver support.
Fixes: QTBUG-74150
Change-Id: If321b3024fbdeb9e199880744b9ee915b3b2bf6c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The sysrootification of OpenGL include paths must be done only once: at
configure time. The resolved paths are stored since 521a8539 and must not be
resolved again.
Turn the makeSpec-type opengl library into a custom-type one, and do
the sysrootification in the handler function.
Fixes: QTBUG-73736
Change-Id: I2933144057d6f01d8bfc7bda2c2df56c57303459
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QSyntaxHighlighter has the follwoing constructor taking a QObject
QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent)
: QObject(*new QSyntaxHighlighterPrivate, parent)
{
if (parent->inherits("QTextEdit")) {
// ...
}
}
Typically, a 'parent' refers to the parent/child hierarchy in Qt
and is allowed to be a nullptr. However, in this case, passing a
nullptr will lead to a crash, as reported in
https://bugs.kde.org/show_bug.cgi?id=404820
This patch makes the QSyntaxHighlighter constructor nullptr safe
by checking if parent is a valid pointer.
Change-Id: Ia4e9b46b94fd37e6ceb2cd0538594353fdc1e349
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Christoph Cullmann <cullmann@kde.org>
The new test tst_QTouchEvent::touchOnMultipleTouchscreens()
needs the touchpoint IDs to be predictable, but another test currently
has a QEXPECT_FAIL; without release events, g_pointIdMap continued to
hold the touchpoints that were there when the test failed. So it's
necessary to add QWindowSystemInterfacePrivate::clearPointIdMap()
to be able to call it in the test cleanup function.
Fixes: QTBUG-73830
Change-Id: Ia6a70d028be95cd2b6676db6363ec408c0b116bc
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
For extreme coordinates, the rasterizer's width parameter could become
NaN, which compares false with everything and hence would trigger an
assert.
Fixes: QTBUG-56434
Change-Id: I27abae6ab0bc94ce042be86ea0587095cdb7d487
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The QImage API can not handle images with more bytes per line than what
an integer can hold.
Fixes: QTBUG-73731
Fixes: QTBUG-73732
Change-Id: Ieed6fec7645661fd58d8d25335f806faaa1bb3e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The bcm_host library couldn't be detected anymore. Let the makespec
provide LIBDIR, INCDIR and LIBS for bcm_host to fix this.
Change-Id: I4bc268504dc48edaf2884f1c14b745260fd9112c
Fixes: QTBUG-73727
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Some platform backing stores may require that the window has been
created, so let's defer the platform backingstore creation until
absolutely necessary.
Change-Id: Ib93151c6473e3bbe77d994782d84289c2f63bcf2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Prevent automatic insertion of line-breaks in blocks formatted with 'white-space:nowrap'.
This follows the example of white-space:pre.
Fixes: QTBUG-54787
Change-Id: If26f6a54106a02fe0e388947f6368ae4e86acf63
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Remove wrong code changing the Bido level of line separators. This
lead to wrong ordering of the string in case the line separator was
meant to be ignored and the string should be rendered in one line. Line
breaks are anyways already reset to the paragraph level by the algorithm
and reordering is done on a line by line basis, so this will work
correctly when doing proper line breaking.
Secondly fix a small bug found while testing the above change, where
we wouldn't set the correct levels for boundary neutrals and explicit
embedding chars because we did that processing before we were fully
done with the BiDi algorithm.
Change-Id: Id88f91cd58d2ab29be864aef34ca1727c1586611
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The algorithm has been treating DirB inconsistently so far.
initScriptAnalysisAndIsolatePairs was treating it differently
than generateDireationalRuns leading to assertions.
It wasn't visible in our test data, as DirB is in almost all cases the
paragraph separator, where we split strings anyway.
Change-Id: I7dc0e7bbcf30ee84d8781ea06097da023e371f05
Fixes: QTBUG-73238
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
By only looking at the function prototype, it's tempting to assume that
the handler needs to be registered with the usual SLOT macro. That is
not the case.
The code snippet is already included in the class description, but it
doesn't hurt to repeat it here.
Change-Id: If24fdca41a4bd976ebd1156c9e1106469388265c
Fixes: QTBUG-50484
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The non-qualified hue() and saturation() etc. refers to those values
in the HSV, not HSL, color model. Make this more explicit in the
documentation to avoid confusion.
Task-number: QTBUG-73129
Change-Id: Ief337672966ac72d0d0c3606d8d68acf01ffe7ee
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
We translate all pure gray colors into cmyk having c,m,y=0 and only
the k value expressing the darkness. But a fix introduced to avoid
division by 0 caused rgb(0, 0, 0) to be an exception to this; it ended
up being translated as c,m,y,k=1 instead.
Fix by catching the potential div-by-0 situation earlier and directly
set the orthodox cmyk translation: c,m,y=0,k=1.
Fixes: QTBUG-73171
Change-Id: I3774eaf9d96e096ac5c47c55d28881bea2bd1309
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
For some overly tight beziers where the start or end point and the
next control point are closer than the pen width, the stroker's
shifting algorithm will produce a start/end tangent pointing in the
opposite direction from what is expected, for one of the sides. This
would break the square and round capping logic. Fix by detecting the
situation in the capping function and reversing the tangent when
necessary.
Change-Id: I48f4f017403d7b289b0483dd2b3a7ff1bbd0cf2a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The read_xbm_header() function is used to check for valid file header,
containing valid width and height values. But in case of an invalid file,
the check could depend on uninitialized variables.
Change-Id: I9f933ed6e38d86109e5b5a8d55fe763ab928d749
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
QPictureIO::read() is using pictureFormat() when the format has to be
guessed. pictureFormat() returns a QByteArray which was implicit
casted into a char* and then pointed to uninitialized memory.
Fix it by using a QByteArray instead a plain char*.
Change-Id: If9ae286ed68134af597f0b0c779789e40f9efaed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a QRawFont is set explicitly on the layout, we would get certain
font properties from the QTextCharFormat instead. But when the properties
had not been set on the QTextCharFormat, we would get the default values
which were always 0/false, not the actual default values used in QFont.
Instead, we calculate a QFont query based on the format and use the
properties from this. This will give us the correct default values
in the cases where they are not overridden.
Change-Id: I53e5103739164c3d9eafaf76fcb4e8bda57bd12a
Reviewed-by: Lars Knoll <lars.knoll@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.
Change-Id: Ic45024fc6df84d70d60c48831fa586f889af0c0b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
QPlatformGraphicsBuffer::byteCount() shouldn't need locking unless
bytesPerLine() is implemented in a way that requires it, in which
case the assert should be in the subclass.
Change-Id: I0fdb04c0a3ab042408d6d17b2759509853573d16
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This allows the user to set the following variables:
FREETYPE_INCDIR
FREETYPE_LIBDIR
FREETYPE_LIBS
Fixes: QTBUG-72765
Change-Id: Ib70b30f355cc2185c45233e0cfe5e6e55acdf2b6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The code path for re-generating the texture already has the unlock, but the
non-regenerating code-path was missing an unlock, causing asserts when the
graphics buffer was then attempted to be locked (again) at a later point.
Change-Id: Ic65add838360079829b7e81d7c1cfe2274959059
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
error #68: integer conversion resulted in a change of sign
Change-Id: I4ac1156702324f0fb814fffd156f80962df6b4a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It was an implicit effect before which stopped working after
dec7961709. Reintroduce it as some
projects used this side-effect as a way to abort the initial
highlighting.
Change-Id: I5340ee9882a242bc8b5f7f843f1cfe793a65d357
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Run the handling in QWindowPrivate::maybeQuitOnLastWindowClosed()
for top level windows only.
Fixes: QTBUG-73061
Change-Id: I74deb50b06a64e8ef0e438d2abf14888f778a46e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Per the Khronos documentation, this operation is not permitted on ES 3.
Change-Id: Iff70ef83d48228277b883df588011432ba80f4bd
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Qt for Python users reading the documentation assume that int(0) can
be passed for pointer parameters. Use the newly introduced \nullptr to
disambiguate this.
In a follow-up step, the \nullptr macro can be defined as None
when generating the Qt for Python documentation.
Task-number: PYSIDE-903
Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Avoid spending time on decoding attempt of invalid bmp files
specifying height or width as 0.
Change-Id: Ia6666088515eee54777f7154868fb7d07c6b4438
Done-with: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
A previous change that extended the maximum PDF size has caused the
generation of invalid PDF output when the current locale was set to
something using commas instead of points when outputting floating
point numbers through printf(). This change uses QByteArray::number()
instead, which uses points, irrespective of the current locale.
Fixes: QTBUG-72868
Fixes: QTBUG-72848
Change-Id: I292eba2d6c89b3e01957bb8c04c04bdca8ada316
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
This fixes a regression introduced by change
c3d2d83fcb.
Change-Id: Idf840804c68cd6b1751e122b45e9dd2775af56f5
Fixes: QTBUG-72900
Fixes: QTBUG-72754
Reviewed-by: David Faure <david.faure@kdab.com>
In function 'QRgba64 rgbBlend(QRgba64, QRgba64, uint)':
error: 'blend.QRgba64::rgba' is used uninitialized in this function [-Werror=uninitialized]
qrgba64_p.h:246:13: note: 'blend' was declared here
QRgba64 blend;
Change-Id: I7b263f863281c51c7d8099704f2cffcc7e1a07df
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The mentioned README file has never been very trustworthy and
after 863c688749 it has become
very minimal - it doesn't contain anything that is not already
present in "configure --help" and enforced by the configure
process. Furthermore, the warning was XCB specific, but Qt
supports also other QPA plugins on linux.
Change-Id: I3211dda3f294cbcd5f3d15fe8c21a1af7627f048
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Qt Test library sources specific to Core, GUI and Widgets modules
were moved around in commit 88867e39b.
The new source locations must be referenced in Qt Test documentation
configuration. The same sources are excluded in their original doc
projects, and the related snippet file is moved over to qttestlib.
The commit also fixes the remaining documentation issues for Qt Test.
Change-Id: Ibe011aa83639e574d647f12bc9e53e618781bce6
Reviewed-by: Martin Smith <martin.smith@qt.io>
This way Qt builders can see if everything has been configured
properly for XCB GL integrations at configure time, instead of
at the end of the build process.
Change-Id: I00740cc2edd7f6ecfcda0ddfb22649d1b4db4aa2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
xcb-xlib is used by XCB and EGLFS_X11.
xlib is used by XCB, EGLFS_X11 and offscreen plugin (not listed
currently under "QPA backends").
egl_x11 is used by XCB GL integration plugin and EGLFS_X11.
Renamed X11 -> XCB under "QPA backends", because that is the
correct QPA name.
Change-Id: I455ac3a41da3ab84453d8de0edc657c3a5e064c9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Its been available by default since at least libxcb 1.5, and in Qt 5.12
we have even increased the minimal required libxcb version to 1.9.
Having configure switches for extensions is a legacy from Qt 4. There
are still few exceptions in Qt5, where the reason is that we have to
support Linux distributions that don't ship recent enough libxcb.
Task-number: QTBUG-30939
Change-Id: I0a02d93b6411119ec018b0cb8fe5c63beeab62ee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
xcb-render is a C interface for X11 extension. xcb-render-util is a
utility library that complements xcb-render by providing convenience
functions and interfaces which make the raw X protocol more usable.
Bumped xcb-render-util version to avoid having include hacks. We were
bundling 8 years old release 0.3.8 (Apr, 2011). 0.3.9 is the latest
release and it was relesed 4,5 years ago (Jun, 2014). All CI machines
have 0.3.9. The only thing that have changed in xcb-render-util sources
since 2011 is that we don't need to have various hacks to include
xcb_renderutil.h in C++ files. Upgrading bundled XCB libs was also
requested in QTBUG-71109.
Task-number: QTBUG-71109
Change-Id: Ib261f7584ad81be95660123b007e2200a3042f4c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
We would draw the tab and space symbols without setting the correct
font on the painter first.
[ChangeLog][QtGui][Text] Fixed so ShowTabsAndSpaces will use the
correct font.
Fixes: QTBUG-62540
Change-Id: I3b7d6d317473e7aab722dafe1a128c57a830f634
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The Qt::ForeignWindow flag is or’ed to d->windowFlags
by QWindow::flags(). Use this getter function instead
of accessing d->windowFlags() directly.
Change-Id: I6a82aa7e379ba51272954ffe7b87f108034da8c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QPlatformWindow::isForeignWindow() should return whether
the native window is of the foreign window type, or
false if the platform (plugin) does not support this
concept.
It should not call QWindow::type(), since that function
may itself be implemented in terms of isForeignWindow().
Change-Id: Ib67a5a44c5c1db0acb4d3bc155e187f8164146d1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When glyphs are converted to monochrome from an alpha map,
it does not make sense to apply high quality dithering, because
the result will be that some the subpixels along the edges
that cover only part of a pixel are filled. This causes the
glyphs to look jagged and ugly.
Instead, we use ThresholdDither to fill all pixels that are
>= 50% opacity.
[ChangeLog][QtGui][Text] Improved appearance of monochrome
text on some platforms.
Fixes: QTBUG-69702
Change-Id: I0f44a8d73f6b9f1eb59f297d66438575f1e9db10
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When eliding text we would check for the existence of the ellipsis
character and fall back to using the dot if it was not available.
However, when font merging was in use, we would also use ellipsis
from a fallback font if available. This could cause the metrics
of the text to increase if the fallback font had larger metrics,
and the result was that text could shift when elided.
It is better to prefer the dot from the current font than to use
the ellipsis from a fallback, so we only use the ellipsis if
it is in the main font.
[ChangeLog][QtGui][Text] Fixed a bug where eliding text could
change the height of its bounding rectangle for certain fonts.
Fixes: QTBUG-72553
Change-Id: Ib27fc65302465ddce661801bcc5ae32e55f1aeb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
these were new on dev while the original migration happened on 5.9, or
came from new changes which hadn't adapted yet.
Change-Id: I5e48437061a97e6df6e93881c98471455e177631
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
as it is now cheap to test for individual libraries and headers, split
the xcb_syslibs monster-library into its parts.
the compile test remains a single blob, though, as that didn't get any
cheaper. whether it's worth keeping it in the first place is debatable.
Change-Id: Id7cae7925bb4d77069437512abecf14feea749f2
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
When building ANGLE, we need the shader compiler (fxc.exe), which is not
shipped with MinGW. Previously, we required an installed DirectX SDK.
For Windows versions >= 8, the DX SDK is also part of the Windows Kit,
so we also allow the user to specify the location of the Windows Kit.
We also detect fxc on 64-bit hosts now, and in newer SDK versions which
version the binary directory.
The detected binary is now exported by configure, so the ANGLE project
file does not need to duplicate the logic anymore.
Task-number: QTBUG-52487
Change-Id: I41a17992909041dd84291b69498195cc8b8fab8a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
properly atomize the libraries and express their dependencies, and
adjust the project files accordingly.
note that we don't try to use any additional paths, as all SDKs we
currently support have built-in directx 11 support:
- msvc2013 comes with win sdk 8.1; that is also used for win7 targets
- mingw-64 5.3 (though this one is missing fxc, which is why the code
path for using an external sdk for that remains)
Change-Id: Ib44e389ef46567308293c2bbcad20a96e8ef70c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Otherwise HarfBuzz will fall back to using default font sizes, e.g. 12.0
in the CoreText backend.
hb_coretext_font_create() already does the right thing, but we're not using
that function, we create the hb_font_t ourselves in _hb_qt_font_create().
The mismatch didn't matter for vector-based fonts as the metrics (presumably)
scale linearly, but for bitmap-based font such as Emojis they don't, and
we ended up with advances that were way too large (increasingly so the
larger the font point size).
Change-Id: I4781dda965c745853732026da91590d8506ec3f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
in addition to the actual library resolution, also resolve the headers
belonging to the library, to validate the include path, and possibly
ensure that the right version of the library is present.
the "include" entries were moved out of the "test" objects, and renamed
to "headers". this cleanly permits libraries without compile tests.
the headers were not put into the sources, because the variance among
the includes is generally orthogonal to the variance among the
libraries.
note that this - like the library resolution - provides no support for
darwin frameworks. consequently, the opengl libraries are excluded from
the conversion on darwin.
similarly, wasm is excluded (centrally), because emcc is magic and would
need advanced wizardry to be dealt with.
Change-Id: Ib390c75371efa2badcfec9b74274047ce67c3e5a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Insufficient memory was allocated when asking GetDIBits() to convert to 32bit.
Fix allocation size and use a QScopedArrayPointer.
Fixes: QTBUG-72343
Change-Id: I45f79c913a243316e01bc6efed08e50ccc7d25f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Resolves "reference to non-static member function must be called" error.
Fixes: QTBUG-72403
Change-Id: Iebd865ff553736df43548b72b45ed3f4711fffc1
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Our glyph caches on 10.14 are based on the application appearance, so when
the application goes from dark to light or light to dark, we need to reset
and re-populate the glyph-caches to account for the new appearance.
Change-Id: If019d8cfa33ffb2b14747444b2ff74b288992f55
Fixes: QTBUG-71018
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This reverts commit ae8389e19c.
The result of malloc should be aligned in any case, and
this change conflicts with the use of realloc on the data elsewhere.
Change-Id: I01773132b240614a2656dd3013490b0df9cd14a7
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
egl-x11 is used in two places:
- the eglfs-x11 plugin, which has a hard dependency on xcb-xlib
- the xcb-egl plugin, which has a soft dependency on xcb-xlib
that means that the egl-x11 configure test needs to be untangled from
xcb, and that eglfs-x11 should be a separate feature with a proper
dependency declaration.
when the plugins that need egl-x11 are not built, it also makes no sense
to build the respective integration in the egl_support module (even if
it's possible to coax it into building), so adjust things accordingly.
Change-Id: Ic729d0b7c893dd00844567329205c24ea2703033
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
xcb is a dependency which should be detected upfront.
same for xlib.
this also removes calls to functions coming from the dependencies from
the tests (both because these calls prove nothing, and because at some
point we will stop linking transitive deps).
Change-Id: Iac77305eab33ea8ff5c71302cef980eb908d8403
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
freetype depends on zlib. using statically linked freetype as system
library lacks the usage requirement to link with zlib. so we need to
add this manually.
Task-number: QTBUG-63115
Change-Id: Iaf0f3027bd9d1386fcc1ecfbfbe07ab09b2d0bb9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It was added in c3a963da1f.
wayland was updated in a8fed20181729cae70de43079c4a34ad1780cfd7.
Change-Id: Ibf458815c3b61c5f936f147086db3d2b5782c175
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
If the document is paged and contains an image spanning more than one
page, correctly set the y position for everything following that
image.
Change-Id: I1c584c7a907c1728c2965f1dc3fdc56069ab3172
Fixes: QTBUG-59886
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The alignment of long long on 32-bit windows is only 32-bits, but we
should be safe to assume it is aligned at 64-bit.
Since QRgba64 is a public type, we can't fix the alignment there without
breaking ABI, so instead fix it where temporary buffers are allocated.
At the same time be consistent about using QRgba64 so we can switch to it
enforcing alignment in Qt6.
Change-Id: Ie15c305bc867c62a13df8eb2b1678e92174e1f97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commits that added this code:
7ce8491280 and
f005dee1b3
I guess this was a work-around, before we started bundling
XCB libs a year later in 21bd66e1ea
0.3.8 was released in 2011-04-26 and we are bundling 0.3.9, so
it is safe to remove the include work-around as well.
Change-Id: I5794f40d86e10ebdad984aa4b61311979aaadcf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
It's a leftover from when the Cocoa plugin used QFontEngineMulti
exclusively. Nowadays QFontEngineMulti will strip out the highByte
before calling into the real engine. Left an assert just in case..
Change-Id: I6cb26d20a908d7c3aaf096297fca160805fdb85b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The only reason why we bundled this library ~6 years ago was because
it was not available on distributions that we supported at the time,
but library was a hard dependency for XCB plugin. See:
2122e731ab
Later more and more projects started to depend on it (compose input
context plugin, libinput, mir, wayland). The configuration had become
too complex, because some projects used bundled and some used the
version from the system.
Having libxkbcommon in 3rdparty sources is not necessary anymore, after
RHEL 6.6 was removed from the list of supported platforms for Qt 5.12.
Ubuntu 16.04 - 0.5.0
Ubuntu 18.04 - 0.8.0
openSUSE 42.3 - 0.6.1
RHEL-7.4 - 0.7.1
This will also simplify further development, e.g. QTBUG-42181
Bumped the minimal required version 0.4.1 -> 0.5.0.
The patch also contains a code marked with "TRANSITION HACK", which
is temporary needed so we can update the dependent wayland module.
[ChangeLog][Third-Party Code] Removed xkbcommon from bundled sources.
This library is present on all supported platforms. The minimal required
version now is 0.5.0.
Task-number: QTBUG-65503
Change-Id: Iec50829bb6f8fbb19f3c4e4ad62e332beb837de5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
No need to return top level window if it was not created.
It means no platform resources have been allocated.
Events might not be delivered if the wrong window is returned.
Fixes: QTBUG-70544
Change-Id: I43462974f70871470f7b7490dc2b3c08846f77b1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Removes assumptions about QImage format in a few places.
Change-Id: I515701be53190429a48956c31986fa0804806406
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Instead of relying on the return value of malloc having the correct
alignment, use proper non-throwing new[] operators.
Change-Id: I06c6c619e21c848f3d184bdb7cef8c5589c1c7ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This special case of macOS appears to be outdated and now causes a bug.
Change-Id: Ie9c074bb69eda7abfe3d123f807b517334cc2958
Fixes: QTBUG-69803
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
fix the plugin name (it was missing the leading 'q') and the name used
in configure (the latter making it unnecessary to mess with it in the
mkspec). the qt.prf override which forced linkage of the plugin is also
removed due to being completely redundant.
Change-Id: I94687a34a295c36754e36a298af902b656ba2ecc
Reviewed-by: Kyle Edwards <kyle.edwards@kitware.com>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Don't start a new page to print a very high line of text if
that line wouldn't fit on one page in any case. In that case
we have to break the image up onto several pages anyway, so
we might as well start it immediately.
Change-Id: I823aa4961df179054476755c8f5df2e03874661f
Fixes: QTBUG-59885
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Inline images can have 4 different alignments. Unfortunately,
AlignTop and AlignBottom can only be set once we have laid out
the whole line and know the total height of the line, as one
could otherwise end up with lines that are too high.
To fix this, position the images for these cases in a second loop
after we have calculated the length of the line and the maximal
image height in that line.
Task-number: QTBUG-59310
Change-Id: I1fd4cd39e43a13d1967b9f5c9ce8270a99269cd9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The logclusters where never correctly initialized for tabs or
inline objects.
Change-Id: I376fd2dba19994eb5add24cdb8a93c38bde8cd1e
Fixes: QTBUG-70946
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
From 64 to 256 MB. Note that this is especially important
because bindTexture() will fail and return an invalid
texture for image data larger than this. That is not ideal
but is trickier to correct. Until that is available, increase
the cache size to alleviate the pain somewhat.
Task-number: QTBUG-59207
Change-Id: Ibc22524acad0b42a632eb7e4cd8ea86225174837
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We document being able to parse more than 8-bit per color, but were
ignoring everything after the first 8 bits.
Change-Id: Ic85ab04b0836e6979a623e294eebd5084c1a9478
Fixes: QTBUG-71373
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QImageWriter's plugin can open devices while operating and only free
them on destruction which means that if one wants to act on the file
written if must first destroy the writer's instance. This patch adds
the suggestion to use a scope to avoid that problem.
Change-Id: I239157ea86c4a93faab237fe1860312a3c7ac7a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
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>