Commit Graph

5944 Commits

Author SHA1 Message Date
Topi Reinio
66c9161d05 Doc: Fix link in QImage::load() documentation
Change-Id: I9a3a059a860f5b21253ab0e7cdc616cbfc9a3885
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-04 09:36:40 +00:00
Gatis Paeglis
dd988e2074 configure: add XCB GL integration features
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>
2019-01-03 10:29:17 +00:00
Gatis Paeglis
0decdcb754 configure: add X11 subsection in "Features used by QPA backends"
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>
2019-01-03 10:09:47 +00:00
Gatis Paeglis
7d8fe4d98f configure: make xcb-render a hard dependency for xcb plugin
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>
2019-01-03 10:09:40 +00:00
Gatis Paeglis
6899117a59 configure: properly atomize render vs. renderutil
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>
2019-01-03 10:09:34 +00:00
Eskil Abrahamsen Blomfeldt
ceddc14af1 Draw ShowTabsAndSpaces symbols with the correct font
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>
2019-01-03 08:48:41 +00:00
Morten Johan Sørvig
f4b77570e2 Make QWindow::type() reflect ForeignWindow status
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>
2018-12-22 21:51:48 +00:00
Morten Johan Sørvig
6881699d76 Fix layering violation in isForeignWindow()
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>
2018-12-22 21:51:38 +00:00
Eskil Abrahamsen Blomfeldt
28b2232e78 Don't dither antialiasing on glyphs when converting to mono
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>
2018-12-21 10:27:22 +00:00
Eskil Abrahamsen Blomfeldt
e6880e7cd1 Fix text shifting vertically when elided
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>
2018-12-21 10:27:12 +00:00
Oswald Buddenhagen
53ae00d03c configure: inline a few more tests
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>
2018-12-17 21:31:48 +00:00
Oswald Buddenhagen
65463764f2 configure: properly atomize xcb-syslibs
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>
2018-12-17 21:29:17 +00:00
Oliver Wolff
7a481fce28 configure: detect fxc.exe more thoroughly
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>
2018-12-17 21:29:11 +00:00
Oswald Buddenhagen
1ef9859e7e configure: refactor directx checks
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>
2018-12-17 21:29:05 +00:00
Tor Arne Vestbø
ae825a48dc Set point size, not just pixel size, when creating HarfBuzz fonts for shaping
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>
2018-12-16 15:02:20 +00:00
Oswald Buddenhagen
e80bf655e9 configure: verify header presence against sources
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>
2018-12-14 23:44:30 +00:00
Friedemann Kleint
d1cafa3eba qt_imageFromWinHBITMAP(): Fix memory corruption when converting from bitmaps with low depths
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>
2018-12-12 16:08:10 +00:00
Allan Sandfeld Jensen
9fbce8d5cb Avoid crash in blitting or fast draw when QPointF is too big
Change-Id: I88182d5d95fda15d33836f16dee78167685b3765
Fixes: QTBUG-72392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-12-11 18:32:53 +00:00
Paul Wicking
9400a120ea Doc: Fix typo in snippet
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>
2018-12-11 14:03:11 +00:00
Tor Arne Vestbø
161c569314 macOS: Reset font glyph caches when application theme changes
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>
2018-12-09 23:22:14 +00:00
Tor Arne Vestbø
2e715c31ed Allow overriding the maximum cached glyph size via the environment
Useful for testing.

Change-Id: I8cfd4453018cba0301287ad6a1c15a88cdc33c1c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-08 15:27:16 +00:00
Allan Sandfeld Jensen
a71f50edc6 Revert "Ensure alignment of image-data"
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>
2018-12-08 08:53:54 +00:00
Oswald Buddenhagen
501ff0a18c untangle the egl-x11 relationship in the build system
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>
2018-12-07 23:49:15 +00:00
Oswald Buddenhagen
3ee7aa72b7 configure: atomize xcb-* tests properly
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>
2018-12-07 23:49:04 +00:00
Oswald Buddenhagen
118b456c6b configure: convert xlib to a proper library definition
Change-Id: I1623aee9e8632e4bfd466e09e275cc23f94c6dab
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-12-07 23:48:48 +00:00
Oswald Buddenhagen
b6737b7ecd wasm: fix freetype library source
Change-Id: Ib99c4c178808c7325e55e85a1548542ae3c57524
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2018-12-07 23:48:30 +00:00
Tim Blechmann
fc2c4edcbd configure: fix linking with statically linked freetype
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>
2018-12-07 23:48:21 +00:00
Thiago Macieira
ea9f11b038 Add a note about virtual_hook
Change-Id: I1ff3b344ec5a4499bb25fffd156b2bf6a7d88625
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-07 18:52:18 +00:00
Gatis Paeglis
28fd625873 configure: remove xkbcommon_evdev transition hack
It was added in c3a963da1f.
wayland was updated in a8fed20181729cae70de43079c4a34ad1780cfd7.

Change-Id: Ibf458815c3b61c5f936f147086db3d2b5782c175
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-07 18:20:56 +00:00
Lars Knoll
416b4cf685 Set correct vertical position for text following a very large image
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>
2018-12-03 10:42:00 +00:00
Allan Sandfeld Jensen
d23d146175 Fix alignment of temporary QRgba64 buffers on win32
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>
2018-11-30 15:14:26 +00:00
Gatis Paeglis
f2b4462f84 xcb: remove old work-around for building with util-wm
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>
2018-11-30 14:05:13 +00:00
Tor Arne Vestbø
b926d5f919 CoreText: Remove handling of QFontEngineMulti's highByte
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>
2018-11-30 10:35:52 +00:00
Gatis Paeglis
c3a963da1f src/3rdparty: remove xkbcommon
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>
2018-11-30 09:47:03 +00:00
Val Doroshchuk
2e86b652b7 Fix crash in QSimpleDrag when no platform window
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>
2018-11-29 13:14:14 +00:00
Tor Arne Vestbø
09e3457541 macOS: Share code for resolving CGImage bitmapInfor for a QImage
Removes assumptions about QImage format in a few places.

Change-Id: I515701be53190429a48956c31986fa0804806406
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:17 +00:00
Tor Arne Vestbø
17cdb28ed5 macOS: Fix use of deprecated enum value
Change-Id: Ibf979837e1adcadcbb100d059b06b1a48157eab6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-28 23:59:17 +00:00
Allan Sandfeld Jensen
ae8389e19c Ensure alignment of image-data
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>
2018-11-28 09:11:28 +00:00
Allan Sandfeld Jensen
7c93f1cf5d Remove macOS specific path that causes reverse vertical advance
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>
2018-11-22 14:26:59 +00:00
Oswald Buddenhagen
54dabdd1e8 wasm: fix qpa plugin build system integration
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>
2018-11-21 23:08:05 +00:00
Lars Knoll
ac4b2a2b8e Don't start a new page when printing very large images
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>
2018-11-21 05:36:46 +00:00
Lars Knoll
199f9c5448 Fix vertical alignment of inline images
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>
2018-11-19 11:45:09 +00:00
Liang Qi
4d180586cd Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm

Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
2018-11-19 12:42:10 +01:00
Liang Qi
37d3bc9ad7 Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
2018-11-16 08:10:15 +01:00
Liang Qi
527406cbd9 Modernize the "settings" feature
Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-15 17:20:15 +00:00
Lars Knoll
c3d2d83fcb Correctly initialize the logClusters array for tabs and objects
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>
2018-11-14 20:16:31 +00:00
Laszlo Agocs
800cd53c7e Increase QOpenGLTextureCache max size
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>
2018-11-14 20:15:47 +00:00
Allan Sandfeld Jensen
2393551665 Fix precision in parsing hex format QColors
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>
2018-11-12 22:18:43 +00:00
Samuel Gaist
178bc49ac2 QImageWriter: improve documentation regarding use of resources
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>
2018-11-12 13:01:20 +00:00
Lars Knoll
a6a5e81cd6 Fix a typo in the docs
Change-Id: I0f1b015a34b8caffa3b60927cedbccf7db50b383
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-11-12 07:16:54 +00:00
Morten Johan Sørvig
c9f375f4e3 Document QScreen::grabWindow high-DPI behavior
Change-Id: Ib32510ff30e907365e64921fda14e686a495c77c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-12 07:15:16 +00:00
Morten Johan Sørvig
8802826de6 Make grabWindow return pixmap with correct dpr
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>
2018-11-11 09:10:05 +00:00
Friedemann Kleint
b20c15f204 QtGui: Check event type in QWindowSystemInterface::handleMouseEvent()
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>
2018-11-09 21:43:38 +00:00
Liang Qi
bc07958f92 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	.qmake.conf
	qmake/Makefile.unix
	src/gui/text/qtextdocument.cpp
	src/gui/text/qtextdocument.h

Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
2018-11-09 10:34:33 +01:00
Mårten Nordheim
dec7961709 QSyntaxHighlighter: Delay all highlights until first rehighlight
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>
2018-11-08 16:38:27 +00:00
Thiago Macieira
9d90c0edac QImage: merge the size calculations with proper (non-UB) checks
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>
2018-11-08 15:20:01 +00:00
Andy Shaw
38b87cc4bb Doc: Clarify what samples() returns if not explicitly set
Change-Id: Icf4478121a9d67356eb976039c666d6945a2099c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-07 16:48:13 +00:00
Sergio Martins
9933511838 Fix typo in define. s/GL_FRAMEBUFFER_SRB/GL_FRAMEBUFFER_SRGB
Found with clazy

Change-Id: Ied84c0fa95a7ae7b7791e167695acfc7877f7e25
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-11-07 14:40:03 +00:00
Liang Qi
825f988156 Modernize the "textcodec" feature
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>
2018-11-07 13:19:54 +00:00
Topi Reinio
8828993c44 Doc: Qt GUI: Fix documentation warnings
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>
2018-11-06 12:43:17 +00:00
Liang Qi
eedb3a06cb Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: I12f26470e01a8582d0f02f51e20d5b742bd95d6f
2018-11-05 19:06:47 +01:00
Allan Sandfeld Jensen
73e7eb785f Enable swizzling
This part was accidently left disabling after testing the
fallback still worked.

Change-Id: Ic2df939753641a9771e68bc8857c570d356cff44
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-05 15:16:24 +00:00
Liang Qi
b36c5bdc30 Merge remote-tracking branch 'origin/5.11' into 5.12.0
Conflicts:
	src/plugins/platforms/cocoa/qcocoaglcontext.mm
	src/plugins/platforms/xcb/qxcbscreen.h

Change-Id: If9b4c67288396ff7346088ce591c7a3588b51979
2018-11-05 09:59:59 +01:00
Jarek Kobus
deee147aca Fix doc
Change-Id: I75386b948763bbe784fc36abe7e69696bc04219d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-31 10:34:01 +00:00
Andre de la Rocha
eb056ee233 Fix painter opacity being ignored when rendering to PDF
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>
2018-10-30 17:48:23 +00:00
Andy Nichols
1b9af84c1b Don't create an offscreen surface when not on the GUI thread
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>
2018-10-30 12:49:53 +00:00
Kirill Burtsev
d2e0e416d4 Fix leaking QTabletEventPrivate instance
Fixes: QTBUG-52279
Change-Id: I4f40fc9d3ce938b4c821f10cacd21e6f652a2227
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-10-25 14:08:32 +00:00
Andy Shaw
509d566ec0 Don't block mouse events if the window is a Tooltip type
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>
2018-10-24 10:47:43 +00:00
Ivan Komissarov
903666a602 qtriangulator: Remove a bunch of dead code
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>
2018-10-22 16:24:25 +00:00
Andre de la Rocha
1bb8627f8f Extend PDF engine to allow the generation of PDFs with huge pages
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>
2018-10-22 15:53:17 +00:00
Ivan Komissarov
07f79a8029 qimagescale: Get rid of the memset call
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>
2018-10-21 18:15:09 +00:00
Anton Kudryavtsev
ef02dd14cd QMovie: use rvalue more
Change-Id: Idf052436190bf225662ff6c1d4b7b8e3c0c84685
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-21 12:11:56 +00:00
Qt Forward Merge Bot
7a252ac467 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Iaf28977e7ecf566b28b9406dcb005d48621169c2
2018-10-21 01:00:09 +02:00
Eirik Aavitsland
6599c1f758 QPicture: fix crash for malformed picture
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>
2018-10-18 09:03:03 +00:00
Mikhail Svetkin
7d03b9b300 qpainterpath: Fix Q_ASSERT typo
Task-number: QTBUG-71156
Change-Id: Id1669f72a684171ad8c72badad56e72ee20ee625
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-10-17 10:53:22 +00:00
Liang Qi
ccf26f6a88 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/plugins/platformthemes/platformthemes.pro
	src/printsupport/kernel/qplatformprintdevice.cpp

Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
2018-10-17 10:35:28 +02:00
Tobias Hunger
a174b3df44 Fix wrong keyword in configure.json
'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>
2018-10-16 11:24:09 +00:00
Allan Sandfeld Jensen
1cd2955173 Fix enum passed to QFontDatabase::findFont
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>
2018-10-16 11:14:31 +00:00
Laszlo Agocs
e0b1c39bed Drop cached shaders when arch is different
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>
2018-10-16 07:20:12 +00:00
Ulf Hermann
402efef57b Don't drop update requests when closing and reopening windows
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>
2018-10-16 07:09:36 +00:00
Gatis Paeglis
00ae1e6b7b xcb: respect QEventLoop::ExcludeUserInputEvents in native event handlers
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>
2018-10-16 06:57:01 +00:00
Eirik Aavitsland
fc4b0769a5 Fix pdf printing in static builds
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>
2018-10-16 06:56:19 +00:00
Cristian Maureira-Fredes
1f6bfc2207 Doc: Move literal code block to a separate file
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>
2018-10-15 10:55:18 +00:00
Eirik Aavitsland
f2f040ae1c Improve support for QImages in QDataStream read transactions
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>
2018-10-15 07:18:57 +00:00
Lorn Potter
52070f3a6c wasm: fix wasm shader compile
This fixes qopenglwindow shader in the triangle

Task-number: QTBUG-67338
Change-Id: I8552183bf9ca45e9b56760b340d014ddd34c21f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-15 00:19:13 +00:00
Giuseppe D'Angelo
72fc65784d QImageReader: add tracepoints for image loading
Change-Id: I5fe25793eeda01a4fa1658091890af23f66b7089
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
2018-10-14 22:00:26 +00:00
Alexandra Cherdantseva
1192c463db QImageWriter/QPNGHandler: Quality option should be CompressionRatio
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>
2018-10-14 19:36:33 +00:00
Christian Ehrlicher
bbe08d6b68 QCss: properly parse functions which contains additional spaces
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>
2018-10-12 22:01:14 +00:00
Liang Qi
3eebadc173 Modernize the "mimetype" feature
Change-Id: I9b67c2cbc0891a38ece18d521c86fbc7344dce7a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:26:33 +00:00
Liang Qi
c593492d16 Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:26:15 +00:00
Anton Kudryavtsev
02f7caaa7d QPixmap: use rvalue more
Change-Id: Ifb8c014abf6e02dc782fab2d653e4edfc4972125
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-10-10 12:20:32 +00:00
Allan Sandfeld Jensen
f864a62ccd Add missing null checks after detach
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>
2018-10-10 08:23:31 +00:00
Allan Sandfeld Jensen
b7c5c2e65b Add NEON optimized ARGB32 unpremultiply routines
Mirroring similar routines recently added for SSE4.1

Change-Id: Ibb9d10cc34655ce1dc0e97fdff4e4f6a81d47d05
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-10-09 13:17:47 +00:00
Qt Forward Merge Bot
b4da5c6b93 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/corelib/tools/qtimezoneprivate.cpp

Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
2018-10-08 10:00:49 +02:00
Allan Sandfeld Jensen
9d27aec869 Optimize gamma-table lookup on SSE2 and NEON
Speeds up gamma-corrected text rendering.

Change-Id: I38c12ff52f4601853c3f3524de2761a932111160
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-10-05 19:56:15 +00:00
Andrew O'Doherty
b2b32d3147 fix HTML subset documentation is not very readable on smaller screens
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>
2018-09-30 21:05:03 +00:00
Friedemann Kleint
97f4366202 QLineEdit: Disable input methods for password unless IME supports hidden text
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>
2018-09-29 19:45:35 +00:00
Laszlo Agocs
76c4a70499 QOpenGLShader: report geom. and tess. on GLES 3.2+
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>
2018-09-28 13:59:42 +00:00
Liang Qi
353a58ceb9 Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-09-27 18:34:12 +00:00
Liang Qi
d0fcaa7eaa Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/widgets/util/qcompleter.cpp

Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
2018-09-27 11:08:55 +02:00
Eskil Abrahamsen Blomfeldt
720e243d88 Fix crash when detaching dangling QTextCursor
When a QTextCursor survives its QTextDocument, the internal
QTextDocumentPrivate pointer is set to null. There are checks for
this in all the QTextCursor functions to skip out early if such
a QTextCursor is used.

However, when executing the "if (d->priv)" condition in setters,
this will access the non-const operator->() of QSharedDataPointer
and detach the QTextCursorPrivate, and in the copy constructor of
this class, there was an unprotected call into priv->addCursor().

In theory, we could cast all the checks for d->priv to avoid
detaching, but in practice this doesn't matter, since the setters
will typically detach anyway later on.

[ChangeLog][QtGui][Text] Fixed a crash that can happen when calling
a setter on a QTextCursor after its QTextDocument has been deleted.

Task-number: QTBUG-70293
Change-Id: I8f6dc5bb344d1d824f673c0c220b68b7fee237a8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-27 06:51:37 +00:00
Aleix Pol
50b995d114 Fix typos in the documentation
Returnes -> returns

Change-Id: I52372488a16d7c13e85fca0e11eaab738db9355d
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-09-25 23:39:06 +00:00
Allan Sandfeld Jensen
c33faac32b More fixups for GL_CONTEXT_LOST
Fixes the rest of the places we use the pattern of emptying the OpenGL
error stack to be able to handle GL_CONTEXT_LOST, and adds a note about
it in the documentation.

Change-Id: I7eb97dbca45f39295b832d44937023b538b19947
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-25 22:35:58 +00:00
Shawn Rutledge
4c631c0bf9 Android: add support for custom buttons in native MessageDialog helper
New API in QMessageDialogOptions and implementation on Android.

Task-number: QTBUG-35545
Change-Id: I59567251199f220862d01ba76979266379eecd86
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-25 14:15:40 +00:00
Eirik Aavitsland
7a6a9dbb7d QImageWriter: Fix default compressionratio
Before asking a image format handler to save an image, QImageWriter
sets the value of all supported options. For options like quality and
gamma, the default value is an illegal value (-1 and 0.0 resp.),
effectively telling the handler that the application has not requested
any particular value. But in the case of compressionratio, the default
was 0, a legal value. Fix by changing it to -1.

Change-Id: Iad6d4c2dbe269b25863e7d4967aa9ed2a7d1247f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-09-25 12:32:34 +00:00
Eirik Aavitsland
b233ce66d3 QPainter cosmetic stroker: Fix painting error for FlatCap lines
Initialize the lastDir properly, to avoid the stroking algorithm doing
direction-change handling for a single line. That could cause a cap to
be painted for a single FlatCap line.

Also fixes a bug in tst_qpainter, revealed by the above fix. The
result drawPolyline was erroneously compared to the result of drawing
the lines individually, for a case where the former correctly paints
the pixel of the join point in the corner, while the latter by
coincidence used to paint the same pixel as a cap because of the bug
above.

Task-number: QTBUG-70101
Change-Id: Ie20eda33214cfe9e7627f17ef4c7a5b3835c9c24
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-25 12:32:24 +00:00
Allan Sandfeld Jensen
1511bfef52 Disable RGB64 backend for ARGB32 when it will be very slow
Fixes a speed regression on ARGB32 painting on low end hardware
introduced when it was switched to using the RGB64 raster routines.
It turns out several of our embedded QPA targets use ARGB32 as native
format.

Task-number: QTBUG-69724
Change-Id: I6d7993c12da46a85b8354eb905930dae9602b5e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-14 16:57:02 +00:00
Qt Forward Merge Bot
42f84de26a Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
2018-09-14 01:00:08 +02:00
Tor Arne Vestbø
704a3989d1 Fix spelling mistake in qimage.h
Change-Id: I2138318894587cc0b5f03af14a57b2a39509f0da
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-13 15:53:18 +00:00
Eirik Aavitsland
9d1c881f49 Texture file support: add mipmap reading to ktx handler
Change-Id: Ic2c10b3e64d63d2272a8a3922d2b3f99dfd45bdb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-12 08:41:38 +00:00
Laszlo Agocs
2d82cb7d77 QVulkanWindow: Fix some load/store ops in the default renderpass
Stencil is - very likely - cleared just like depth. Also, switch to
STORE_OP_STORE for the multisample buffer, for correctness.

Change-Id: I31b56658286205af8551018115ca2abbe541be67
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:20 +00:00
Laszlo Agocs
d6c7089e6c QVulkanWindow: Fix bogus stage masks in readback
Change-Id: I08882a02204c95272b100647923c9903f825912c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:17 +00:00
Laszlo Agocs
1c6bd414dd Fix device local alloc in hellovulkantexture
Running with QT_VK_FORCE_STAGE_TEX does not work at all with recent
NVIDIA drivers due to QVulkanWindow's and the example's naive way of
picking the memory index. Enhance this and add a warning note to the
QVulkanWindow docs as well.

Change-Id: I7f200e11d982b56e3da3b71ee3915bd7bfca5cc1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-12 08:34:15 +00:00
Allan Sandfeld Jensen
73af8e7553 Add optimized fetch ARGB32 routines for NEON
After convert and fetch were split, only convert was still NEON
vectorized, while fetch is the more commonly used version.

Change-Id: Iea2af7ccee6589b3d6e9908afeaae2d1ad2753be
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-12 07:26:55 +00:00
Paul Wicking
cfb8d70888 Doc: Fix typo and add precision to method description
As transform() returns worldTransform(), point out that it is an alias
in its description.

Fixes: QTBUG-18117
Change-Id: I0eb1f78c6955b499906024105f9969cdccf13303
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-09-12 06:42:40 +00:00
Eirik Aavitsland
621ab8ab59 bmp image handler: check for out of range image size
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.

Change-Id: I874e04f3b43122d73f8e58c7a5bcc4a741b68264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-11 06:36:34 +00:00
Liang Qi
683e144efb Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	mkspecs/common/macx.conf

Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
2018-09-10 12:12:46 +02:00
Tor Arne Vestbø
8b3a6cfbfb Update QOpenGLContext::currentContext after QPlatformOpenGLContext::makeCurrent
Instead of doing it up front and then restoring the current context
if the makeCurrent call failed.

By delaying the update, QPlatformOpenGLContext::makeCurrent has the option
to check which context was current before the call.

Change-Id: I458f5c00d7c820acbe2f8552b0513fce99b9b683
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-09 11:10:38 +00:00
Qt Forward Merge Bot
1f1e2aa57b Merge remote-tracking branch 'origin/5.11.2' into 5.11
Change-Id: I2fa26fa061cbf5d2bded203a299a19b7d1c31d0a
2018-09-09 12:13:02 +02:00
Juan Jose Casafranca
5474f28c42 Graph loader can load prototypes stored in the graph
Change-Id: Ib0bbfe5b0257bf355e83cc5287fa52b1e0cc3ed6
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-09-08 17:11:06 +00:00
Tor Arne Vestbø
be60b541ad Make QOpenGLContext::makeCurrent use early exit for all its flow
The case of the platform context failing makeCurrent is the exception.

Change-Id: I606e6fb379f84e886bff9e27355dda9b31ff9ebe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-08 14:04:51 +00:00
Qt Forward Merge Bot
295cd87c6d Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
2018-09-07 01:00:21 +02:00
Luca Beldi
dc73a691bf Fix QSIM::itemData returning role 255
Before this fix, QStandardItemModel::itemData returns
a map containing role 255 which is used internally to store the flags.
This role is an undocumented implementation detail so it should
not be returned to the user.

[ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255

Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 11:51:28 +00:00
Laszlo Agocs
85f127cb04 Revise an incorrect QVulkanWindow doc note
Applying the transformation in question has no effect on the winding
order. Rewrite that section.

While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).

Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-09-06 09:17:53 +00:00
Allan Sandfeld Jensen
5d0ee89132 Fix reading 16bpc grayscale PNGs
They were incorrectly attempted to be read as Indexed8, instead use
the RGBA64 formats to read them with full accuracy.

Task-number: QTBUG-45858
Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-03 08:24:10 +00:00
Jan Grulich
101cb8e5d9 Make flatpak portal support to be used also by Snap applications
Snap now uses xdg-desktop-portal for portal support. Add check for apps
running in Snap and make them use portals by default. We also should be
using different name for the platform theme used by sandboxed apps.

Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 14:15:38 +00:00
Andre de la Rocha
8ada0633cd Windows QPA: Stop synthesizing mouse events from tablet/touch
These fake mouse events should be synthesized by QtGui, not the QPA plugin,
when the tablet/touch events are not handled by the application and the
Qt::AA_SynthesizeMouseForUnhandledTouchEvents or
Qt::AA_SynthesizeMouseForUnhandledTabletEvents flags are set.

Task-number: QTBUG-47007
Task-number: QTBUG-60437
Change-Id: I4d6d5e6667d245c45a4eb4f3a94db05cf9772f52
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-01 14:42:49 +00:00
Allan Sandfeld Jensen
244c7bd193 Avoid conversion over RGBA64 for RGB32 LCD text blending
Short-cuts the case where there is no gamma correction to avoid a
conversion over RGBA64 and back.

Change-Id: I100697a9f7a4b94283557b2c0eaa45e0eff81785
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-30 18:39:32 +00:00
Venugopal Shivashankar
059b10f295 Doc: Check before including the \snippet from a .pro file
Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-08-30 09:23:42 +00:00
Morten Johan Sørvig
29c0377f07 WebAssembly for QtBase
This is the squashed diff from wip/webassembly to dev.

Done-with: Peng Wu <peng.wu@intopalo.com>
Done-with: Sami Enne <sami.enne@intopalo.com>
Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Started-by: Andrew Knight <andrew.knight@intopalo.com>
Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-30 06:48:33 +00:00
Eskil Abrahamsen Blomfeldt
707ae5b667 Silence warning in gcc 4.9 for Android
When building with warnings are errors for Android with gcc 4.9,
it wrongfully fails on use of uninitialized variable.

Change-Id: I39c5e8413c30567fba60cbba6a8b26d537c5836e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-08-30 06:46:33 +00:00
Allan Sandfeld Jensen
384fc28b90 Fix out of buffer access in qt_qimageScaleRgba64_up_xy
Avoid reading a pixel outside the image even if we multiply the result
by 0. This mirrors a similar old fix in the the 32bit scaling path.

Change-Id: I7860bc808dc46dbc94918672e99c81b56d4a1d27
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-29 23:18:07 +00:00
Frederik Gladhorn
900ce73b6f Merge 5.11 into 5.11.2
Change-Id: I672bc167de3801c944315d92120c5e03da69e9c7
2018-08-27 15:49:03 +02:00
Qt Forward Merge Bot
1d077120f4 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I5f1567c792992fc00f0256f39b76cfbe017e6a3a
2018-08-24 23:59:46 +02:00
Eskil Abrahamsen Blomfeldt
f71048a531 Fix crash when combining QOpenGLWidget, QStaticText and Qt Quick
Under certain circumstances, if you had a widget with a QOpenGLPaintEngine,
and drew QStaticText into this, and then later had Qt Quick access the same
cache and try to resize it, we would get a crash because the resize function
would have a pointer to the paint engine and try to access its shader manager
(which would now be null, since this is outside the begin()/end() phase of the
paint engine.

The solution is to reset the paint engine pointer to null on the cache once it
has been populated and it is no longer needed.

[ChangeLog][QtGui][Text] Fixed a possible crash when combining QStaticText,
QOpenGLWidget and Qt Quick in the same application.

Task-number: QTBUG-70096
Change-Id: I7383ad7456d1a72499cfcd2da09a5a808d4b3eff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-24 08:30:28 +00:00
Allan Sandfeld Jensen
ed557c0378 Handle uploading of faked sub-images
One trick that is possible to do with QImage is to make it be sub image
of its imagedata by manipulating the data start and bytes-per-line,
we can not upload that directly and need to detect the case and create
a clean copy to upload.

Task-number: QTBUG-70105
Change-Id: I7ce184a0892fb4071b6dcc1a1fd3881a4e0703cd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-23 17:32:20 +00:00
Friedemann Kleint
2ab804c452 clangcl: Fix QtGui link error (missing fetchPixelsBPP24_ssse3)
Do not try using SSSE3 if the compiler do not support it.
(see 648ee7aa02).

Task-number: QTBUG-50804
Change-Id: I489b0bbacfde0c647c9d5b71ca3de992d7dc8878
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 14:04:55 +00:00
Mårten Nordheim
4f6fa5b2ae configure: add sources matching names from vcpkg
It's possible to use vcpkg using the -I and -L arguments, but
some of their libraries have different names than what we look for
during configure, so add in those variations.

Change-Id: Iee37197228cc0f15442ecd7ec4fc761f4d526e1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-23 14:03:28 +00:00
Mitch Curtis
972dd1c544 Doc: fix typo in QNativeGestureEvent docs
Change-Id: I83ac3463752488d7dbb758ea767ba186ddd3fa2a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 09:36:21 +00:00
Allan Sandfeld Jensen
991b251e39 Fix big-endian build of qopengltextureuploader
Badly placed endif and lacking a break statement.

Change-Id: Id6a3fb13b40e8ae8029e74f7668bafb6e0b9dd06
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-22 14:32:45 +00:00
Liang Qi
9be1256e0c Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-08-22 10:31:09 +00:00
Allan Sandfeld Jensen
dc82a0f4f3 Smooth image scaling for 64bit images
Adds support for smooth scaling 64bit images.

Task-number: QTBUG-45858
Change-Id: If46030fb8e7d684159f852a3b8266a74e5e6700c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-22 10:03:15 +00:00
Liang Qi
7533156b68 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/gui/text/qtextengine.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h

Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
2018-08-22 10:35:12 +02:00
Mitch Curtis
76c328b2b3 Fix spacing in << operator for QEvent
Turns

     QNativeGestureEvent(ZoomNativeGesturelocalPos=686.855,312.836,
         value=0.0259857)

into

     QNativeGestureEvent(ZoomNativeGesture, localPos=686.855,312.836,
         value=0.0259857)

Change-Id: Id30860a3c7a1b6da583369126a31934ddb32d4b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-21 14:45:58 +00:00
Allan Sandfeld Jensen
07eda676e4 Fix big-endian build
Declare rbSwap<QImage::Format_RGBA8888>, so we don't end up in a
fallback definition not used by little-endian.

Task-number: QTBUG-69951
Change-Id: I8512bba76da7d59a27593d37c70283d881c3e8fc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-21 13:31:44 +00:00
Friedemann Kleint
81d6cf71cc Windows QPA: Add option to detect AltGr key presses
According to MSDN, AltGr key presses are sent as a
sequence of SYS left Ctrl + right Alt.

Add an option to detect AltGr as modifier key.

Task-number: QTBUG-69317
Change-Id: I30ce169d2e6dbbae194ff714abfbc732b53652ce
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-21 06:30:53 +00:00
Oswald Buddenhagen
5a03b75c50 Merge dev into 5.12
Change-Id: I63f632b595f66d2fc93e9aa713500e3799e3df2a
2018-08-21 02:32:50 +02:00
Albert Astals Cid
0e7724079f Allow setting the QIcon fallback theme
This allows apps that know their icons are
in a given icon theme to set that theme as
fallback, so in case the user theme does
not include them, the icons can still be found.

This solves the problem of missing icons
that often happens when running KDE applications
on a GNOME desktop.

Change-Id: I4e5543d598012352a29ff79dab0357506d986b6d
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-20 21:42:58 +00:00
Samuel Gaist
bcd80eebf9 Implement exact match expression builder for QRegularExpression
QRegularExpression doesn't offer a direct equivalent of QRegExp's exact
match.

There are several places in the Qt sources that use this feature. This
patch implements a small helper function that builds the expression as
recommended in the documentation and updates the related code.

[ChangeLog][Core][Tools] QRegularExpression now provides
anchoredPattern() which is a helper function to build regular
expressions used for exact matching.

Change-Id: Idbbf142c4c5cb9b62abf8229f4ce85fd4409e5d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-19 11:38:26 +00:00
Jesus Fernandez
6b65be5554 Improve Q_ASSERT readability
Change-Id: I231ecafe1eb48d74f787083e86a85536a90ed69b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-17 15:07:09 +00:00
Tor Arne Vestbø
e09f5b1786 macOS: Teach QWheelEvent to handle a new ScrollMomentum phase
We detect if there's an upcoming momentum phase using the same trick
used by e.g. Mozilla in their event handling: https://tinyurl.com/yd8lcs4l,
and as recommended by an Apple engineer: https://tinyurl.com/y8yytlgv

The event is not guaranteed to be in the queue, but in practice it seems
to be. If this assumption fails we can add a wait timeout to the event
search instead of using [NSDate distantPast] as a timeout (which only
looks at queued events).

When the momentum phase is detected, QWheelEvent::phase will have the
new ScrollMomentum value, and the phase transitions will be
ScrollBegin -> ScrollUpdate -> ScrollMomentum -> ScrollEnd.

We no longer send ScrollEnd to signify that the user's fingers have
been lifted off the trackpad; rather, the first event with ScrollMomentum
phase means that the fingers have been lifted and macOS is now sending
simulated-momentum events.

This means ScrollEnd is a reliable indicator that the entire scroll
gesture (both the user interaction and the momentum) has ended.

If the ScrollMomentum phase is skipped, it means the user's fingers
came to rest before being lifted, so there is no momentum. In that case
the transitions will be ScrollBegin -> ScrollUpdate -> ScrollEnd.

Task-number: QTBUG-63026
Task-number: QTBUG-65160
Change-Id: I80191a472f6fa892387004c199166a6350124274
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-17 15:01:38 +00:00
Liang Qi
ae5476eadc Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-08-17 12:22:55 +00:00
Lars Knoll
055ff7a8a4 Don't reset the bidi level on spaces
Fixes a regression introduced with the update to the bidi
algorithm.

Task-number: QTBUG-69633
Change-Id: I7eac45ed3ffb41f89ea3f793eedcfb6fcdace871
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 08:23:26 +00:00
Lars Knoll
1702ae24b3 Only show the bidi cursor mark if we actually have bidirectional text
Don't show the mark simply because we have unicode code points
larger than 0x590.

Task-number: QTBUG-69665
Change-Id: I9af97383f3bcd52277a5288e7ad06ec240c7e51c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 08:23:20 +00:00
Luca Beldi
d0069ff8c9 Add a method to clear the data to QStandardItemModel
After the behavior of setItemData has been changed following QTBUG-45114,
QStandardItemModel was lacking an interface to clear all the data from a single index.

Task-number: QTBUG-69616
Change-Id: Ide0b5bb6358439fc42c474df8b044fbace6def8d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 07:17:12 +00:00
Qt Forward Merge Bot
8842d9d1e6 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8bb8227f9da982e7d5ebe5324fc27abd9ac0d4fc
2018-08-17 09:08:06 +02:00
Ulf Hermann
0a06e1baf9 Modernize the "thread" feature
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.

Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 00:34:36 +00:00
David Edmundson
29778037f8 Don't block on lost context
When glGetError returns GL_CONTEXT_LOST, on XCB + Nvidia at least, the
error does not get cleared until the next successful
glGetGraphicsResetStatus.

We can't handle this properly until the start of the next frame where we
will hopefully have a valid context, but in the meantime we should avoid
locking up completely.

Change-Id: Id438d44d83b926e1f3e4281ca3704231bf1a23cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-08-16 22:04:10 +00:00
Liang Qi
8559bf934d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/plugins/platforms/xcb/qxcbbackingstore.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I4af138ffb2f5306373244523768209e8873b2798
2018-08-16 18:48:59 +02:00
Alexander Volkov
242ea38375 doc: Add missing override and remove redundant virtual for snippets
Change-Id: I2395fd01b93c4ea364225e0cf1a5f59908b691d0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-16 11:00:31 +00:00
Tor Arne Vestbø
e86b1d4424 Fix documentation issue for QOpenGLContext::makeCurrent
Change-Id: Id0118e44e1ed44fecdd803dbc57ca0588a1afec0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-15 13:17:36 +00:00
Tor Arne Vestbø
5c07efffac Improve QWheelEvent debug output
We now include the phase, which is helpful, and we distinguish between
modern wheel events with a pixel and/or angle delta, and compatibility
events sent from QWindowSystemInterface::handleWheelEvent with the old
Qt 4 single value delta and orientation.

Change-Id: I2efe9fe7a55c43240ec94bfa70cafaac6d52603c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-15 13:17:17 +00:00
Allan Sandfeld Jensen
65491150b2 Add direct conversions between RGB30<->RGBA8888
Expands the existing conversions for ARGB32<->RGB30 to also handle
RGBA8888 to avoid any performance regression of the 16bpc conversion
path.

Change-Id: I34e519a04276b0e7ff00c6125ba06c889045d2ac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-15 11:35:16 +00:00
Frederik Gladhorn
4fdda5a584 Fix delta in QWheelEvent passed to QQuickItem
While the property is deprecated, we should still set it, even in the
legacy free constructor. The window system never sends x and y changes
at the same time, so either coordinate will be null, therefor add them.
This should restore the old behavior.

Task-number: QTBUG-69089
Change-Id: Ie329cb4196f53c70b25934cbbac5e2e48c65d2b3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-08-14 20:06:55 +00:00
Martin Smith
109af99261 qdoc: Fix several minor errors to reduce qdoc warnings
This update corrects several minor documentation errors that
cause qdoc warnings. These include incorrect or missing \fn
commands, incorrect uses of \e and \a commands together,
incorrect spellings, etc.

Change-Id: Ib26edef541fa3440025490bcf79cc101623e7f7b
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-14 17:54:55 +00:00
Erik Verbruggen
30e26d258b macOS: Handle missing key in QKeySequencePrivate::decodeString()
On macOS we pull out all the modifiers up front, which in the case
of incomplete key sequences such as "Meta+Shift+" will result in
an empty string as a result. The cross-platform code does not
handle that case, so we need to exit early.

This fixes an assert in tst_QKeySequence::parseString().

An assert has been added to QKeySequencePrivate::decodeString()
to make the assumption about the 'accel' argument explicit.

Change-Id: I135e62f9051a8b899202e5fb224b5d3c77bf2062
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-14 13:35:16 +00:00
Allan Sandfeld Jensen
9c9f98f2ff Implement support for 16bpc image formats
Adds support for 16bit per color image formats in QImage. This makes it
possible to read and write 16bpc PNGs, and take full advantage of the
16bpc paint engine.

[ChangeLog][QtGui][QImage] QImage now supports 64bit image formats with
16 bits per color channel, compatible with 16bpc PNG or RGBA16 OpenGL
formats.

Task-number: QTBUG-45858
Change-Id: Icd28bd5868a6efcf65cb5bd56031d42941e04099
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-08-11 14:12:48 +00:00
Eskil Abrahamsen Blomfeldt
65a1d41a09 Fix potential crash when showing line/paragraph separators
When showing line and paragraph separators at an offset from the start
of the string, the end of string pointer would be incorrectly set, and
we would read past the end of the string. If any part of this memory
happened to match the line or paragraph separator, then we would
overwrite it and have a crash.

I couldn't find any reliable way to test this, since the crash depends on
the contents of the memory after the string allocated by the algorithm.
But with an overflow of 100 000 characters, I found that it crashed every
time I ran the test.

[ChangeLog][QtGui][Text] Fixed potential crash when using
QTextOption::ShowLineAndParagraphSeparators.

Task-number: QTBUG-69661
Change-Id: I17d1996b883560bacdc7ce114c8aeb2b0108faea
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Michal Lazo <xlazom00@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-08-09 12:46:22 +00:00
Qt Forward Merge Bot
577654047a Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoabackingstore.mm
	src/plugins/platforms/cocoa/qcocoascreen.mm

Change-Id: Iac965aea4867059dbf7bc401b71e8e8b5b259afb
2018-08-08 11:20:22 +02:00
Liang Qi
ee2e38490d Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-08-07 18:12:02 +00:00
Qt Forward Merge Bot
053e7cce79 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/doc/src/objectmodel/signalsandslots.qdoc
	src/plugins/platforms/cocoa/qcocoamenuloader.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	tests/auto/gui/image/qimage/tst_qimage.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
2018-08-07 17:44:51 +02:00
Tor Arne Vestbø
5c1c403edb Add logging for QPlatformBackingStore::composeAndFlush
Change-Id: I96778296480d2aaad5e01ed15353106bc90d4d2b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-08-07 10:19:50 +00:00
Tor Arne Vestbø
e7063e6cc6 Add QPlatformScreen::windows() helper to return all windows on screen
Change-Id: Ib55b37b64ed0890ca777dfea8c4d702e267c34bf
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-08-06 20:14:55 +00:00
Tor Arne Vestbø
be35539123 Use consistent naming of QPA screen change callbacks in QGuiApplication
Change-Id: I76be8a993e5d71e472faf9a5770b4c1128e8a4c6
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-06 20:14:55 +00:00
Eirik Aavitsland
7dfc3ed663 Fix potential out of bounds read in qpkmhandler
Off-by-one bug in the validity test of the texture type field.

Change-Id: I46ded85a0ad93166aa886e71f0c391f27e79f64f
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-08-06 12:04:08 +00:00
Tor Arne Vestbø
819cad6670 Be more explicit about the effects of swapBuffers() on the current context
Change-Id: I7ab9e4e7323d49cf19774bfd0c51f8516ecb842d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-08-06 11:42:15 +00:00
Jüri Valdmann
b3574edd2f QTextureFileData: Fix build with -no-opengl
Need to include <QSize> for operator<<(QDebug, const QSize &).

Change-Id: I4857e9b43918243af66cc09ff352619595c081c9
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-08-06 08:45:51 +00:00
Thiago Macieira
d8d0325394 Remove member function from CentralFileHeader
I could have placed the class in an unnamed namespace. That would
mark the member function as a local symbol too. But I preferred to
move outside so I could make it static.

Change-Id: Ie01831ddac5446fdbdeefffd154688c0883ed653
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-03 20:26:52 +00:00
Thiago Macieira
9bb27ca6cc Make local symbols of some leaked names
Unnamed namespaces and static are great tools. Use them.

Change-Id: Ie01831ddac5446fdbdeefffd15468b3acb3ced79
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-03 20:26:50 +00:00
Allan Sandfeld Jensen
3014e2bf01 Don't ignore alpha values in grabFramebuffer methods
Returns an ARGB32_Premultiplied image when the framebuffer
is grabbed on a transparent QOpenGLWidget or QOpenGLWindow.

Task-number: QTBUG-55245
Change-Id: I4b7778ecc38275be1ed9fb748c77c7e1f6b65a00
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-03 18:18:13 +00:00
Tor Arne Vestbø
a882ffc603 Handle screen changes for non-top-level windows
The platform may emit screen changes for child windows before top-level
windows, so we need to update the top level screen as soon as possible.

Change-Id: I090c620725c9c3171f5b038708d78ddfeec8512d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-03 16:01:34 +00:00
Paul Wicking
ae289884db Doc: Fix wrong link in QFont documentation
Task-number: QTBUG-62072
Change-Id: I587534fc5723b3d198fe2065fbcf1bee4871a768
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-08-03 12:15:29 +00:00
Allan Sandfeld Jensen
65cd6f2e82 Fix conversion from transparent indexed8 to RGB32
A typo meant the color-table was not fixed. For safety fallback colors
are also made opaque.

Change-Id: I3e609882177604910c4343c86f00221a89af9078
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-03 10:42:38 +00:00
Allan Sandfeld Jensen
cdf154e65a Optimize blits of any compatible formats
The fast image blending is only used for SourceOver composition, but
several of our embedded backends make heavy use of Source composition
which doesn't have a short-cut. This patch adds a blitting short cut
that works in those cases.

Task-number: QTBUG-69724
Change-Id: Icc61a67cc27bc83863153d69cae60dd986d26f69
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-03 09:36:57 +00:00
Allan Sandfeld Jensen
1c8f9eb79d Add missing optimization for loading RGB32 to RGBA64 using NEON
The rest of the RGB64 routines were optimized, but the loading of RGB32
was not as it was originally not used much, but with ARGB32 using the
RGB64 backend, it is essential for decent performance.

Task-number: QTBUG-69724
Change-Id: I1c02411ed29d3d993427afde44dfa83689d117e0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-03 09:37:02 +00:00
Eirik Aavitsland
8c4207dddf Fix crash in qppmhandler for certain malformed image files
The ppm format specifies that the maximum color value field must be
less than 65536. The handler did not enforce this, leading to
potentional overflow when the value was used in 16 bits context.

Task-number: QTBUG-69449
Change-Id: Iea7a7e0f8953ec1ea8571e215687d12a9d77e11c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-03 08:01:47 +00:00
Błażej Szczygieł
c5af04cf8a HiDPI: Fix calculating window mask from pixmap on drag and drop
Use platform window directly for setting a mask to prevent bitmap
scaling if pixmap and window DPR are the same.

Amends: 42f788ffe2

Task-number: QTBUG-61948
Change-Id: I5eec85c01f20bdefff7343e83ff10cbcb2c79508
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-02 07:09:44 +00:00
Edward Welbourne
cf2d59bfe8 Merge "Merge branch '5.11' into dev" into refs/staging/dev 2018-07-31 11:34:23 +00:00
Edward Welbourne
23c9d4c98f Merge branch '5.11' into dev
Conflicts:
	qmake/library/qmakebuiltins.cpp
	src/plugins/platforms/windows/qwindowstabletsupport.h
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Done-With: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
2018-07-31 13:33:14 +02:00
Tor Arne Vestbø
7621bb0f3b Add debug logging operator for QPlatformSurface
Change-Id: I2adecf87fa058bf973f4e4eed0a4c002f8359728
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-31 11:26:56 +00:00
Tor Arne Vestbø
0f1f9d4224 testlib: Fix qtguiglobal.h include in qtestsupport_gui.h
Change-Id: I7aeb881821bdf501efb9616250911d7b3cc58300
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-31 11:21:19 +00:00
Safa AlFulaij
d1493b972b QTextDocumentFragment: Use logical cursor movement instead of visual
Using QTextCursor::Left and QTextCursor::Right moves the cursor visually to right or
left, which does not work with Right to left text, where moving left means advancing to
the next character, and vice versa.

By using QTextCursor::PreviousCharacter and QTextCursor::NextCharacter we leave it up to
the engine for deciding where to move depending on the context.

Task-number: QTBUG-50619
Change-Id: Ibf0a886f3ff6bf9ca2c953aeff8c235612bbc01d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-07-31 05:05:04 +00:00
Allan Sandfeld Jensen
0bb760260e Fix tiling of NPOT textures on GL/ES
The emulation was not working since the vertices are clamped before
getting to the fragment shader. So instead just resize the brush if
not supported.

Change-Id: I856e47890cd3021874b77d869a6ff7162cadde10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-27 16:10:45 +00:00
Allan Sandfeld Jensen
e65371caf9 Fixup GL_RGB10 FBO on OpenGL/ES3
Turns out on OpenGL ES, only the GL_RGB10_A2 form is allowed as a
render buffer storage format.

Change-Id: I42915b61835167ae457aae91da7e75065dd3eb21
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-27 12:13:27 +00:00
Allan Sandfeld Jensen
ede3791df8 Move texture uploading out of QOpenGLTextureCache
This way the logic can be reused elsewhere.

At the same time a standard OpenGL ES/3 way of handling BGRA is added,
so we don't depend on extensions, and handling of NPOT and max size
which QSGTexture will need.

Change-Id: I475bc7127f44be3964fdb482c9e86a20db1fbca5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-27 12:12:34 +00:00
Jesus Fernandez
318b15db15 Remove dead code
The ascending variable was a leftover from an old implementation. Now
it's not needed anymore. It's safe to remove it, and the condition can
be removed as well.

Amends commit 699e8fe3a6

Coverity-Id: 11004
Change-Id: I003b7016e9bd3bd523fb70ed4de84211ec840a78
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2018-07-27 12:11:39 +00:00
Paul Wicking
0538b714de Doc: Remove typo and add line breaks after \internal
In an unrelated change, it seems \internal \obsolete
can cause unexpected behavior when generating the
documentation. Adding this line break should fix that.

Change-Id: I95eceb109faaf89be8f258fba8c31008fdc4ca57
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-07-26 11:11:37 +00:00
Eirik Aavitsland
731538fdd4 Add API for reading and decoding graphical texture files
Add a framework for reading and decoding stored graphical texture file
formats. Includes decoders for the PKM and KTX formats.

This is basically the same texture file reading that was added to
qtdeclarative for 5.11, but has been refactored to be independent of
the scenegraph and opengl.

Task-number: QTBUG-67026
Change-Id: I87d8117550d8a2112f4f58c03e9ac6b3249cbc5a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-24 16:46:05 +00:00
Eirik Aavitsland
1ed0b2170d Give the QGradient presets ObjectMode coordinate mode by default
ObjectBoundingMode has inconsistent behavior and is deprecated in
favor of ObjectMode.

Change-Id: I748f6283f3db5869bb9a67c08bf5f16abc6f95b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-24 16:45:53 +00:00
Joerg Bornemann
781beb6eb9 Remove transitioning include from qdnd_p.h
Now all files that use QInternalMimeData include
qinternalmimedata_p.h, and we can remove the transitioning include
from qdnd_p.h

Change-Id: I6c86cb6a5bd73076e5dd3bafc01861b75ab83845
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-07-23 05:50:12 +00:00