Commit Graph

5944 Commits

Author SHA1 Message Date
Friedemann Kleint
6fb2b4b271 QPA: Prevent QPlatformWindow::initialGeometry() from returning invalid geometries
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>
2019-05-22 09:26:36 +02:00
Morten Johan Sørvig
4c9758f1af QHighDpi: Simplify top-level window handling code
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>
2019-05-14 19:31:16 +02:00
Richard Moe Gustavsen
cc33dd0797 QMenu: show shortcuts in context menus by default
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>
2019-05-15 11:40:12 +00:00
Joni Poikelin
9bb5491c06 Fix QRasterBuffer::scanLine miscalculation with big images
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>
2019-05-14 06:23:21 +00:00
Morten Johan Sørvig
3af7b27917 Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windows
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>
2019-05-13 13:52:32 +00:00
Allan Sandfeld Jensen
4d2ee7f358 Add unvectorized fallback in case FP exceptions are not masked
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>
2019-05-10 19:35:10 +00:00
Eirik Aavitsland
95fa35fc72 Fix possible endless loop when stroking curves
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>
2019-05-08 12:34:19 +00:00
Dmitry Kazakov
dffad7e3cc Fix swizzling when rendering QPainter on QOpenGLWidget with Angle
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>
2019-05-07 09:56:17 +00:00
Jüri Valdmann
b5154b5254 Fix QTextEngine::shapeText casing of surrogate pairs
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>
2019-05-07 07:50:33 +00:00
Shawn Rutledge
6afdbfdaaf Use "monospace" as fallback system FixedFont in KDE theme; logging
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>
2019-05-07 07:48:43 +00:00
Kai Koehne
c57520e491 Document how to use CMake on Qt Core, Qt GUI's central pages
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>
2019-05-07 07:46:21 +00:00
Nick Shaforostov
4d5fb551d6 fix compilation with various -no-feature-* options
Change-Id: Ic1975db497613e3efe50be4246c167efe10d8e31
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-05 09:14:48 +00:00
Massimo Callegari
ff447717a2 configure: skip Freetype/Fontconfig autodetection only on MSVC
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>
2019-05-03 17:00:42 +00:00
Paul Lemire
389dec3e7c Only generate temporaries when it makes sense
- 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>
2019-05-02 12:47:05 +00:00
Alexander Volkov
ef3daddae1 Use QPlatformTheme::TouchDoubleTapDistance for touch events
... and update the cached values on theme change.

Modify tst_QWidget::touchEventSynthesizedMouseEvent()
to avoid unexpected double click detection.

Change-Id: I151c47e851ebba7550b1b09caca2781c28d7d3d9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-01 20:29:16 +00:00
Milian Wolff
75c0c02641 Don't pass scope args to _exit trace points
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>
2019-04-30 07:42:19 +00:00
Alvin Wong
c9002ab7ee Fix QOpenGLDebugLogger crash on ANGLE
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>
2019-04-27 10:41:44 +00:00
Joerg Bornemann
bbfc95914f Fix determination of OpenGL include paths on macOS, take 3
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>
2019-04-27 07:32:53 +00:00
Lars Knoll
b4cc294347 Fix page breaking with large images
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>
2019-04-26 18:21:18 +00:00
Eirik Aavitsland
d6c3fa6e0c Fix aliased painting with non-uniform scaling
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>
2019-04-25 06:07:00 +00:00
Eirik Aavitsland
8f8267f00b Avoid hanging on painting dashed lines with non-finite coordinates
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>
2019-04-25 06:06:45 +00:00
Tor Arne Vestbø
585150e3d9 macOS: Clean up and deduplicate QMacCGContext
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>
2019-04-19 15:34:30 +00:00
Friedemann Kleint
10327549cb QOffscreenSurface: Suppress setting of a default geometry on the window
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>
2019-04-11 10:48:59 +00:00
Paul Lemire
a552864c3b QShaderGenerator: don't generate temporary variables for global inputs
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>
2019-04-10 09:52:53 +00:00
Paul Lemire
60181f13a3 QShaderGenerator: fix substitution for attributes on GL2/ES2
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>
2019-04-10 09:52:50 +00:00
Paul Lemire
d92f63122b QShaderGenerator: stop abusing from auto everywhere
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>
2019-04-09 04:46:20 +00:00
Qt Forward Merge Bot
01a269593d Merge remote-tracking branch 'origin/5.12.3' into 5.12
Change-Id: Id60d508c0f25fd5e67be07daafd2d4c56ae73934
2019-04-08 09:53:39 +02:00
Milian Wolff
127518deda Introduce Q_TRACE_SCOPE to simplify tracing of a function entry/exit
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>
2019-04-05 11:57:52 +00:00
Milian Wolff
6ce2a87c23 Forward declare all types required for compilation with -trace
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>
2019-04-05 11:57:39 +00:00
Albert Astals Cid
bdee1189bf png handler: initialize all the variables passed to png_get_IHDR
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>
2019-04-05 08:53:01 +00:00
Eirik Aavitsland
4e24bb24a2 Remove noisy warning for undefined QGradient preset
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>
2019-04-05 07:39:25 +00:00
Andy Shaw
5caaa0b6a2 Doc: Update QImage::depth to indicate we support 64 bpp now
Change-Id: Icbd4920ed03655cec483a402de9d0ae3378ff3ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-04-04 08:31:47 +00:00
Allan Sandfeld Jensen
7518da2441 Update scanline documentation
Change-Id: I019b102e99f99377b528ad5c8a4ccb2a7929f14f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 08:31:33 +00:00
Eskil Abrahamsen Blomfeldt
a65800cc68 Add a clarification about "characters" to QTextCursor docs
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>
2019-04-02 06:51:21 +00:00
Alexander Volkov
011794130c Forward physical parameters for derived QImages
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>
2019-04-01 15:21:27 +00:00
Alexander Volkov
685b8db13a Forward devicePixelRatio in QPixmap::mask()
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>
2019-04-01 15:21:18 +00:00
Eirik Aavitsland
3b7db8ac90 Fix assert/crash when creating QBrush with null QGradient
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>
2019-04-01 11:56:42 +00:00
Kari Oikarinen
18e4cf2900 Merge 5.12 into 5.12.3
Change-Id: I76905e3540585c3be221b89453c725828b05940b
2019-04-01 09:16:33 +03:00
Laszlo Agocs
28a264cfe2 Fix alpha blending regression with WA_StacksOnTop QOpenGLWidgets
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>
2019-03-30 19:22:17 +00:00
Allan Sandfeld Jensen
ff8d9ad5bc Speculative fix for building on INTEGRITY with ARM NEON
Avoid using inline assembler

Task-number: QTBUG-72716
Change-Id: I696efb5a787416eb4fc5ba3a250461aaa9a4afc2
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2019-03-29 13:06:12 +00:00
Gatis Paeglis
c3226bd5cc configure: add linker flags for xkbcommon* when pkg-config not present
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>
2019-03-25 13:50:49 +00:00
Eskil Abrahamsen Blomfeldt
be6c70ed7f macOS: Don't scale advances to 0 when stretch is AnyStretch
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>
2019-03-25 06:30:05 +00:00
Friedemann Kleint
2f97a050bc Add explanatory comment to QWindowPrivate::resizeAutomatic
Amends a1c37462ee.

Task-number: QTBUG-74176
Change-Id: I24fa3e5d88e53e7efb8923fb4c55615a4f90abea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-03-22 17:06:20 +00:00
Albert Astals Cid
85a9009f25 QPixmap: More safe failing if qApp is not a QGuiApplication
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>
2019-03-22 08:06:43 +00:00
Friedemann Kleint
a1c37462ee Windows: Fix tooltip flicker on GL surfaces
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>
2019-03-21 13:39:51 +00:00
Alexander Volkov
b0145f029c Handle device pixel ratio in QIconLoaderEngine::paint()
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>
2019-03-20 10:16:42 +00:00
Tor Arne Vestbø
2bafd997ee Don't quit when last QWindow is destroyed, wait for it to close
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>
2019-03-19 19:31:42 +00:00
Tor Arne Vestbø
01e1df90a7 Move screen maintenance functions from QPlatformIntegration to QWSI
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>
2019-03-19 13:08:25 +00:00
Shawn Rutledge
9f9ed383c6 Replace LDEBUG with categorized logging in QTextDocumentLayout(Private)
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>
2019-03-18 10:16:39 +00:00
Qt Forward Merge Bot
a1808c5dbe Merge remote-tracking branch 'origin/5.12.2' into 5.12
Change-Id: I5f9d8090a07056411fb65d7de60eb679d00e99a3
2019-03-15 11:10:10 +01:00
Tor Arne Vestbø
77a4915bf9 macOS: Add IOSurface based backingstore for layer-backed views
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>
2019-03-14 21:51:27 +00:00
Giuseppe D'Angelo
6620f93a74 QOpenGLContext: fix docs about sharing
FBOs cannot be shared. Streamline the remainder of the sentence.

Change-Id: I654b23f86f4ee4ea2ca8e71958464d9f55394297
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-03-13 16:16:17 +00:00
Aleix Pol
131c760af6 Fix generation of the Qt5::GLESv2 target on ARM
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>
2019-03-05 13:31:42 +00:00
Allan Sandfeld Jensen
17a51c4e0d Don't split bezier curves that are already just a line
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>
2019-03-05 08:54:23 +00:00
Allan Sandfeld Jensen
55cc93e9d6 Prefer BGRA uploading to swizzling
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>
2019-03-02 08:25:19 +00:00
Joerg Bornemann
49ef377349 Fix determination of OpenGL include paths on macOS, take 2
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>
2019-02-27 09:53:52 +00:00
Dominik Haumann
16cb578a8d QSyntaxHighlighter: Fix crash when parent is a nullptr
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>
2019-02-27 06:36:59 +00:00
Shawn Rutledge
1500d2283e Clear only one device from g_pointIdMap when all points released
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>
2019-02-26 19:52:25 +00:00
Eirik Aavitsland
1e0395f73e Fix assert when drawing lines with extreme coordinates
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>
2019-02-25 08:26:21 +00:00
Kari Oikarinen
33707f5b2f Merge 5.12 into 5.12.2
Change-Id: I3a5721aebd3afd8fa08d3f3df6bf61502fa9c347
2019-02-20 12:37:31 +02:00
Allan Sandfeld Jensen
a5cded843f Avoid creating wide images with negative bytesPerLine
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>
2019-02-14 07:48:38 +00:00
Joerg Bornemann
797f686ea4 Turn bcm_host library into makeSpec source
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>
2019-02-14 07:27:34 +00:00
Tor Arne Vestbø
18f415e46d QBackingStore: Make QPlatformBackingStore creation lazy
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>
2019-02-13 12:37:18 +00:00
Kai Koehne
d6c474b49b QTextDocument: Do respect white-space:nowrap
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>
2019-02-13 08:14:47 +00:00
Tor Arne Vestbø
c4e9eabc30 Don't allow backingstore flush to non-raster surfaces
Change-Id: I8e85706727a8c5f7585e34e3864c8a9f48481b92
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-02-12 13:53:16 +00:00
Lars Knoll
035d80407b Fix two smaller bugs in the BiDi engine
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>
2019-02-09 08:01:26 +00:00
Lars Knoll
79f2a9e666 Fix an assertion in the BiDi algorithm
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>
2019-02-09 08:01:16 +00:00
Lars Knoll
4247d7c5a0 Fix QTextTable:insertRows() for tables with spanning cells
Don't resize the height of cells spanning several columns
multiple times.

Fixes: QTBUG-36713
Change-Id: I5eb45892f2008e6a4f85745b56efd04323e25673
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-02-09 08:01:08 +00:00
Volker Hilsheimer
c66ddd7aba Include relevant example code in documentation of setUrlHandler
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>
2019-02-06 04:15:26 +00:00
Eirik Aavitsland
a2b8f891fa Doc: decrease confusion about HSV vs HSL in QColor
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>
2019-02-05 22:47:46 +00:00
Eirik Aavitsland
01f090e9e4 Fix QColor::toCmyk() for rgb(0, 0, 0)
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>
2019-02-05 22:47:33 +00:00
Eirik Aavitsland
66c3a71e91 Painter path stroking: fix capping of beziers ending in tight turns
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>
2019-02-05 22:47:16 +00:00
Eirik Aavitsland
e96641d881 Fix xbm image format handler: properly reject invalid files
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>
2019-02-05 22:47:07 +00:00
Albert Astals Cid
50447bb7a3 Initialize bit_depth
==12==WARNING: MemorySanitizer: use-of-uninitialized-value
   #0 0x6b90ea in setup_qt /src/qtbase/src/gui/image/qpnghandler.cpp:360:32

Change-Id: Idf04130e645dcf589dfb6260661be18a71b7bdc2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-31 12:08:34 +00:00
Christian Ehrlicher
0bde49bd92 QPictureIO::read(): don't work on dangling pointer
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>
2019-01-30 17:38:25 +00:00
Albert Astals Cid
f383fa4b9c png: initialize color_type to 0
Fixes
==12==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x6b8179 in setup_qt /src/qtbase/src/gui/image/qpnghandler.cpp:247:9
on fuzzed file

Change-Id: I772d536a0db91665dc16e94751ef507de1064376
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-30 10:13:27 +00:00
Eskil Abrahamsen Blomfeldt
4514cf27b2 Fix default font properties when using raw fonts for text layouts
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>
2019-01-29 17:36:24 +00:00
David Edmundson
6abed98e87 Fixups for GL_CONTEXT_LOST in QOpenGLExtensionMatcher
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>
2019-01-29 11:15:24 +00:00
Tor Arne Vestbø
775b5e2631 Remove requirement to lock graphics buffer before getting total size
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>
2019-01-29 11:06:28 +00:00
Kai Koehne
6358f8e302 QtGui: Unify license headers
Change-Id: I0a2553b95b099fdfa83d42e71bdf9a192a6588c7
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-01-29 10:41:31 +00:00
Joni Poikelin
9bbeb7e6e8 Prevent QPixmap::load from touching QPixmapCache in non-gui threads
Change-Id: Ied0fec48c81298743f694f317dd60e58d356f69a
Fixes: QTBUG-72523
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-28 14:52:57 +00:00
Eric Lemanissier
fffe5d6225 configure: handle FREETYPE_* variables
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>
2019-01-24 22:28:54 +00:00
Tor Arne Vestbø
c907becbf1 Always unlock graphics buffer after binding texture during composeAndFlush
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>
2019-01-24 20:25:00 +00:00
Qt Forward Merge Bot
e3da05f39a Merge remote-tracking branch 'origin/5.12.1' into 5.12
Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
2019-01-23 10:13:29 +01:00
Thiago Macieira
0c007a87be Fix change-of-sign warnings in ICC 19
error #68: integer conversion resulted in a change of sign

Change-Id: I4ac1156702324f0fb814fffd156f80962df6b4a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-01-23 04:13:55 +00:00
Rolf Eike Beer
230921a7f0 fix crash if no screens are available
Fixes: QTBUG-73166
Change-Id: I936672b7a09a540d21e6dcd371f5ffe1e5536b85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-21 15:25:02 +00:00
Gatis Paeglis
f43f636f50 configure: fix a bug where -no-xcb implied eglfs_x11=no
Change-Id: I89bbef23a0abd7692b9bda7b356502f5450af6cc
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-01-22 06:35:08 +00:00
Mårten Nordheim
f8f0f3eef1 QSyntaxHighlighter: cancel delayed highlight if done manually
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>
2019-01-16 14:23:37 +00:00
Friedemann Kleint
b782004149 Fix multiple emission of QGuiApplication::lastWindowClosed() when native child widgets are used
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>
2019-01-16 07:16:43 +00:00
Michael Brasser
a7fa2618e4 Update QOpenGLTexture::generateMipMaps for ES 3
Per the Khronos documentation, this operation is not permitted on ES 3.

Change-Id: Iff70ef83d48228277b883df588011432ba80f4bd
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-01-15 19:39:41 +00:00
Friedemann Kleint
3eac688ec0 Documentation: Add \nullptr macro and use where applicable
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>
2019-01-10 22:16:07 +00:00
Eirik Aavitsland
74c8aa7608 bmp image handler: Reject invalid 0-dimension files early
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>
2019-01-08 16:35:15 +00:00
Andre de la Rocha
81c3c66bb4 Fix PDF generation for locales using comma as decimal separator
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>
2019-01-08 16:35:03 +00:00
Lars Knoll
a8db9b8663 Fix a crash in QTextEngine when a paragraph only contains a tab
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>
2019-01-08 16:34:36 +00:00
Kai Koehne
2e2832a499 Fix typo in fontconfig autotest
Change-Id: Ie6ef3aa654083cd23320eda99660ff85050d999c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-01-08 13:12:57 +00:00
Timur Pocheptsov
98552a84ce Emit paletteChanged and send ApplicationPaletteChange on theme change
Fixes: QTBUG-72575
Change-Id: I407e081295a456a7bdd36de91ca5bbf74bba6078
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-08 11:43:16 +00:00
Liang Qi
0e96b5fe48 Merge remote-tracking branch 'origin/5.12' into 5.12.1
Conflicts:
	src/widgets/kernel/qtooltip.cpp

Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
2019-01-08 09:34:24 +01:00
Liang Qi
772f56c3cf Fix warnings about uninitialized variables - qrgba64_p.h
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>
2019-01-07 14:57:03 +00:00
Gatis Paeglis
abcf7a103e configure: improve warning when all qpa plugins disabled with features.gui
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>
2019-01-07 07:27:35 +00:00
Topi Reinio
3b03150aa2 Doc: Restore documentation for QTest functions in other modules
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>
2019-01-04 12:16:56 +00:00