When trying to find the screen, the function would always
try to determine the screen by checking parents, despite
QWindowPrivate::positionAutomatic being false.
Determine the screen from the initial geometry when
QWindowPrivate::positionAutomatic is false. Bail out when
positionAutomatic and resizeAutomatic are false.
Fixes: QTBUG-75940
Change-Id: I3cd1b16feab16c89d29856cf3e1bccf2c89280c7
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Introduce origin(QWindow *), which returns the point
around which coordinates should be scaled: the screen
origin for top-level windows, and (0, 0) for child windows.
The code paths for top-level and child windows can
then be combined.
Change-Id: I6b9cdbd9e7c2d9406e9137e325c4eb5c79e3ac9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change c2c3452ba introduced a new API in Qt to let QPA inform
whether or not shortcuts should be shown in context menus. This
was set to false by default, since by observation, this seemed to
be the most common behavior across platforms. The problem
is that it left no way for the application to override it; The
attribute Qt::AA_DontShowShortcutsInContextMenus simply doesn't work
when shortcuts are always off. And for some application, showing
shortcuts is not just a matter of look-and-feel, but also important
information to be able to use the application the way intended.
This patch reverts the behavior back to how it was in Qt-5.9, where
shortcuts where shown by default (except on macOS where we still keep
them off). It's no so much because the "always off" logic is wrong, but
because there is no (easy) way/work-around for an app developer to switch
them back on (until Qt-5.13, where a new API is introduced to fix the
situation: b1a9a77). And this lack of API can be a show-stopper for some
when upgrading from e.g 5.9 LTS to 5.12 LTS.
This downside of this patch, OTOH, is that it can cause more
change that what is normally wanted in a patch release. But out of
two evils, this is the best option. Those that wan't to hide shortcuts
can set AA_DontShowShortcutsInContextMenus to true, which now will
work.
[ChangeLog][QtWidgets][QMenu] Shortcuts are again shown by default
in context menus, except on macOS. They can be forced off by
setting AA_DontShowShortcutsInContextMenus to true.
Fixes: QTBUG-69452
Change-Id: Ibcc371395944ac5b19b1d20889940da271bf73d5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
scanLine is overflowing with big images. Similar change was made in
4f88475a96 to fix the same issue with
QImage::scanLine.
Fixes: QTBUG-75082
Change-Id: Ifedf28fa9a303c189dfcd12bd4ec11f438540c2e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Make these functions handle the case where a window spans multiple
screens, and high-DPI scaling is enabled, and the local position (in the
window) is not on the window primary screen (as returned by
QWindow::screen()).
This is done by detecting the case, and then calculating
the correct position using the native coordinate system.
[ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle
windows spanning screens correctly.
Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io>
Task-number: QTBUG-73231
Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
If an application enables FP exceptions our FP-based unpremul will
raise the INVALID exception. Since disabling them locally might be slow
just take a slow path when detected.
Fixes: QTBUG-75592
Change-Id: Ie22a032a4f62229f68ad21ede359c62291adc9bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The bezier shifting algorithm compared coordinates exactly, and so
could end up in an endless loop when values were at the edge of the
number resolution. Fix by using fuzzy comparison instead.
Fixes: QTBUG-75522
Change-Id: I61346edbd87389f66965a906ac337fc1f5300e5c
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
OpenGLES specification does not support GL_TEXTURE_SWIZZLE_RGBA,
it supports only per-channel calls. And since Qt supports QpenGLES,
it should use the latter approach only.
The regression was introduced in Qt 5.12 by commit
ede3791df8
Task-number: QTBUG-74968
Change-Id: I9c531b248715992fb30df6af95dfa605e2ee2a25
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The high part was not copied to output.
Fixes: QTBUG-75559
Change-Id: I9350e52d256510f52b3fcc0015bf879d2c609532
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Also de-duplicate the "monospace" string in qgenericunixthemes.cpp,
and add tst_QFontDatabase::systemFixedFont() to verify that
QFontDatabase::systemFont(QFontDatabase::FixedFont) really returns
a monospace font across platforms. Replace commented-out qDebug()s
with qt.text.font.match and qt.text.font.db logging categories to
troubleshoot when the test fails (among other uses). Add qt.qpa.fonts
logging category to unix themes to show default system and fixed fonts
(font engines on other platforms are already using this category).
Fixes: QTBUG-54623
Change-Id: I2aa62b8c783d9ddb591a5e06e8df85c4af5bcb0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Add documentation on how to use a module from CMake, alongside
the existing documentation about qmake. Separate generic info
from module-specific examples, to make it possible to use one
include file in all modules.
While at it, also remove the mentioning of the central include;
it is not something we should actively advocate anymore. Instead,
the documentation of every class gives the correct include to use.
Task-number: QTBUG-73058
Change-Id: I6b3c0e5ea218dd9c06a491c8fb799a7fcf42dd92
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
In Windows there are package-based systems like MSYS2 that provide
pkg-config for packages lookup.
This change skips autodetection only for MSVC which doesn't
provide the aforementioned feature.
Task-number: QTBUG-57436
Change-Id: Iaed517e93031adbd2fd9dbf350764f76569b94ea
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
- Never for global inputs
- Otherwise only if the temporary is referenced more than once
-> meaning it's actually caching the result of some operation
Tests updated accordingly.
Change-Id: Ic76615370d23dee3965ca6350d5257a8be5a3e22
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
When we trace a scope, then we pass the scope args to the _entry trace
point. There is no need to do that also for the _exit trace points, it
just blows up the trace data for no obvious gain. Any decent tracing
consumer can easily find the args for the _exit call by matching it to
its _entry call.
Note that this is standard practice in trace points, and also done like
this in the Linux Kernel trace points for example.
Change-Id: I273293b0c7e799767acc1960b50ab675fc765a36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The helper in QOpenGLDebugLogger did not account for the extra "KHR"
suffix in the function names and results in a crash when ANGLE is being
used. This commit fixes this issue.
Change-Id: I439d8bfc53b010be5410286b86c090aff171aaef
Fixes: QTBUG-62070
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The sysrootification of QMAKE_INCDIR_OPENGL on macOS must happen only
once. Commit 49ef3773 addressed this but stored the sysrootified
QMAKE_INCDIR_OPENGL in qt_lib_gui_private.pri. For installer packages,
these paths are the paths of the build machine and most likely wrong
on the user's machine.
This reverts commit 4949ef377349ba4dae840c2d5caa36e2d516707baa and
restores the sysrootification in sdk.prf. The original include paths
are assigned to QMAKE_EXPORT_INCDIR_OPENGL and stored as
QMAKE_INCDIR_OPENGL in qt_lib_gui_private.pri.
Fixes: QTBUG-75374
Task-number: QTBUG-73736
Change-Id: I4c0f65866d60660c632363dba3adc7ea2e344bfc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Don't go into an infinite loop breaking pages, when an image is about
as large as the page. Correctly take top and bottom margins into account
when calculating whether the image could fit on one page.
Amends change 416b4cf685.
Fixes: QTBUG-73730
Change-Id: Id311ddf05510be3b1d131702f4e17025a9861e58
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The full stroker does not produce good results for aliased lines
thinner than 1 pixel. Avoid it by making sure that such thin lines
are painted by the cosmetic stroker, even when they have
non-uniform transformation.
Fixes: QTBUG-73866
Change-Id: I7b5f0fa555903246e0c3fd92cd435cc8c0b15a24
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The dash stroker did not check for inf/nan coordinates.
Fixes: QTBUG-47887
Change-Id: I1e696cd15cc37d8fcb6a464cac3da33c3a8b95c2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We now use QCFType to track the CGContextRef, instead of manually
maintaining the lifetime of the context. A bunch of unused methods
were removed, including completely broken ones like isNull().
Change-Id: Ib5a05aadbf8f228192e74c9a4c8919580b831497
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When investigating the bug report, it was discovered that the
offscreen window is assigned a default geometry by
QPlatformWindow::initialGeometry(), causing subsequent resize events
and flushing of event queues. Suppress that by making it a popup which
is not subject to window title bar restrictions on Windows and setting
the respective flags.
Task-number: QTBUG-74176
Change-Id: I7f9c1a3bfd57072c8188a98124bde87491dd25eb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Up until now, the QShaderGenerator would create temporary variables
for uniform, attributes, const. This change makes it use the global
inputs directly rather than relying on the intermediate properties.
Change-Id: Ia9497367d61e536969fe87536606f309c286dbb2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
GL2/ES2 expect it to be attribute and not in like later versions of OpenGL.
Task-number: QTBUG-74829
Change-Id: Iddd22386ed315d6e6843d8225e49a4b73b6ad9ba
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Leads to a huge loss of context for people trying to understand
and maintain that code. Replacing with proper types to ensure
better readability and maintenance.
Change-Id: I9900b743e8b7fe11bcc7db9ce3191c89f8718afc
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Additionally, we also add a Q_TRACE_EXIT which runs a trace point when
the scope is exited, leveraging qScopeGuard behind the scenes.
Q_TRACE_SCOPE uses Q_TRACE_EXIT internally - the difference is that
the _SCOPE version enforces the naming scheme of _entry / _exit for the
tracepoints, whereas Q_TRACE_EXIT can be used generically.
Change-Id: I4a2f5ea09f451fcf664d07fd493b679f7527ac06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch fixes compilation with `-trace lttng` or `-trace etw`. We
need to forward declare QEvent, QImageReader etc., otherwise the types
will be unknown while compiling the trace points.
In order to handle this generically, the tracegen utility is extended
to support a 'prefix text' in the `*.tracepoints` input files. Any
text within curly braces will be embedded as-is in the generated file.
This can then be used to add forward declarations for the types we
need, including potential namespaces and such.
Change-Id: I5cb16763ce0fcb48ce3ea4577578d468ff3a4f4b
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
oss-fuzz found at least width is sometimes not initialized, and we're
initializing almost all of them in most cases so be complete.
the oss-fuzz instance was
==1==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x667c43 in operator!= /src/qtbase/src/corelib/tools/qsize.h:173:25
#1 0x667c43 in setup_qt /src/qtbase/src/gui/image/qpnghandler.cpp:403
Change-Id: Idb9aaf5ab85509d9c893beaf8d9118339ba46be7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This runtime warning was recently introduced in the fix for an
assert/crash when creating a brush with an invalid Preset
value. However, that overlooked the usage where an unknown value is
passed to QGradient constructor, and the code afterwards checks if
the result is a NoGradient or not. It turns out that such usage is
already established as legitimate, including in the Qt Quick Rectangle
code, so this warning would be spit out continuously for perfectly
legal qml code.
Change-Id: Id60aed0817da0214b6cf17edd245f67e26470413
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The function name QTextCursor::positionInBlock() may give users the
idea that it can be displayed to the user as the visual position of
the cursor in the current block. This becomes confusing with some
writing systems, since e.g. a surrogate pair will count as two
characters while only representing a single visual grapheme.
Since it is an side effect of the encoding that will be unexpected to
many, and since it also touches on some linguistic complexities, we
add a note to the documentation to make users aware of the
consideration needed.
Task-number: QTBUG-74725
Change-Id: Iba28ba8a6ad07ee38dbb7e6a5a4b68c93d4da76a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
More specifically, for masks and rotated images.
Add tests for it, also add tests that image metadata is
forwarded for converted and copied images.
Fixes: QTBUG-49259
Change-Id: I05d4a468b17f53a2625500b871c01b2c53b981a1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Also add a test checking that devicePixelRatio is forwarded to
derivatives of QPixmap.
Change-Id: Idb2b3f033ccc0fd49bf54b11f5dffbce5a19b006
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The QBrush constructor taking a QGradient would assert or crash if
passed a null (NoGradient) gradient. But it is not necessary for the
API to be as brittle as that: instead the result can simply be a null
QBrush object, i.e. the same as the default QBrush() constructor
creates (style == NoBrush).
This issue comes up now since with the recent introduction of
QGradient presets, the API opens for using QGradient directly, whereas
earlier, only the subclasses QLinearGradient etc. were to be used.
Fixes: QTBUG-74648
Change-Id: I1a9b1c4654e4375aa6684700a262cc0946851448
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
0bc4288689 in Qt 5.6 introduced support for premultiplied alpha in the
raster-rendered QWidget content. Unfortunately this introduced a
regression for OpenGL content from QOpenGLWidgets with WA_StacksOnTop
set: these used standard alpha blending in 5.5 and earlier, and
switching them to premultiplied (in case the - unrelated - raster
content has a _Premultiplied QImage format) breaks all content that
was done with non-premultiplied alpha in mind, for example the qopenglwidget
example's "Transparent background" checkbox.
Restore the pre-5.6 behavior.
Fixes: QTBUG-74285
Change-Id: I76fcadd53cd436efa2b619b8d6739270995d044f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Avoid using inline assembler
Task-number: QTBUG-72716
Change-Id: I696efb5a787416eb4fc5ba3a250461aaa9a4afc2
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Without this, xkbcommon feature would not be detected even if all
xkbcommon dev libs are present.
Change-Id: Ic247461dda9e7ddfed547708cccaad88f123903b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If the stretch is set to AnyStretch, then this is taken to mean
we should accept the font as it is. But on mac, there is a special
code path to scale the advances since the shaper doesn't do it
for us, and this neglected to check the stretch, thus it would
scale the advances by 0%.
This happened when loading a file directly in QRawFont and using
this in a QTextLayout, since no part of the code path will attempt
to calculate the stretch in that case. Reproducible in q3dsviewer
in Qt 3D Runtime 2.3.
Task-number: QT3DS-3132
Change-Id: I8f934f3fac41bf7a93c01cca0416d44003119907
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It can happen that QDataStream is fed a QVariant that contains a QPixmap
representation, that will make the application crash when trying to
restore it
This is specially important for cases in which applications expose dbus
interfaces with QVariantMaps
Change-Id: Ife4feaef30f30e7e27d88464bd6b2a247f743123
Reported-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QPlatformWindow::initialGeometry() would assign a default height to
the initial geometry of the QRollEffectClassWindow since it has height
of 0. This causes the obtained geometry to not match and subsequently
a geometry change being sent synchronously.
Introduce a new flag QWindowPrivate::resizeAutomatic similar to the
existing QWindowPrivate::positionAutomatic to prevent assigning a
default size and pass through the geometry as is where required.
Fixes: QTBUG-74176
Change-Id: I70c66490838a2c4dfe200ec86094d28bd984dd03
Reviewed-by: Kati Kankaanpaa <kati.kankaanpaa@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QIcon::paint() paints blurry icons on HighDPI screens.
In particular, it is called by QCommonStyle to paint
icons for CE_ItemViewItem's.
Change-Id: Iffe6bd01a8756e617656195ef63fe13c968e0832
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Destroying windows happens independently of closing them, e.g. when
a window is moved from one screen to another non-sibling screen.
The logic for quitting the application should apply to the actual
closing of a window, as documented.
Change-Id: I2226aff29278aa6fbf054a0994a320eb53196e9e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QWindowSystemInterface is the de facto API for any plumbing going from
the platform plugin to QtGui. Having the functions as protected members
of QPlatformIntegration was idiosyncratic, and resulted in awkward
workarounds to be able to call the functions from outside of the
QPlatformIntegration subclass.
The functions in QPlatformIntegration have been left in, but deprecated
so that platform plugins outside of qtbase have a chance to move over to
the new QWSI API before they are removed.
Change-Id: I327fec460db6b0faaf0ae2a151c20aa30dbe7182
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This adds four new logging categories:
qt.text.drawing, qt.text.hittest, qt.text.layout and qt.text.layout.table
Task-number: QTBUG-72457
Change-Id: Ifbfd6d16231c7f4ba664bc521699e44f98310f77
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>