Commit Graph

5944 Commits

Author SHA1 Message Date
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
Albert Astals Cid
8d77bcc562 Replace 0 with nullptr
So if people are using the -Wzero-as-null-pointer-constant don't get a warning when using these private QPA includes

Change-Id: I6deb089b17a844680db24998d60c94de7a1227b1
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-07-19 15:47:09 +00:00
Qt Forward Merge Bot
1783fca897 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/xcb/qxcbintegration.cpp

 Conflicts git missed:
	src/plugins/platforms/qnx/qqnxglcontext.cpp

Change-Id: I0582cdc9e66e43efe79038b9c43d4f9572ac88fc
2018-07-17 10:19:22 +02:00
Takumi ASAKI
37bd2400fa Fix incorrect warning message in QOpenGLBuffer
Change-Id: I932aa10814049e78da35ea12b7552bf676545c89
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-17 01:51:43 +00:00
Oswald Buddenhagen
05d49415ea configure: group tests' includes properly
this puts the actually relevant includes into the correct field, which
potentially allows early header resolution, and is generally just
cleaner.

Change-Id: I9db870442d22a329441eafe53098d18cdc91ce16
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-16 15:46:00 +00:00
Tor Arne Vestbø
88867e39bc testlib: Move qtestsystem helpers to their respective modules
Having the helpers in each respective module lets us implement the
helpers using private APIs without forcing the test to add private
dependencies.

It also makes it easier to test Qt using a third party testing
framework (for running the test suite), while still using the helpers
for ensuring tests behave expectedly.

Change-Id: I2a6ce24526ed345f3513548f11da05c7804c203f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-16 15:30:30 +00:00
Eirik Aavitsland
9a3359b57b Fix: png handler returning Mono QImage with color table < 2 items
A bit depth 1 png image may contain a single color table item. The png
handler would in such cases reduce the size of the QImage color table
to 1, which could easily lead to crashes later on.

Task-number: QTBUG-69256
Change-Id: I01d78977c121bacc44b823231d8f32ca63d8a98c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-07-16 13:49:56 +00:00
Nicolas Ettlin
94a65fb232 Fix the copyright year of the qgrayraster.c dependency
The copyright year of the qgrayraster.c dependency was incorrectly set
to “2006-2015”, instead of 2000-2016 (as stated in the file’s header
comments). This commit solves this issue.

Task-number: QTBUG-69261
Change-Id: I307b6eabdd133fe4f8371b963577b59af8620838
Reviewed-by: hjk <hjk@qt.io>
2018-07-10 15:12:44 +00:00
Tor Arne Vestbø
d27dd47ffa iOS: Document how to handle URL requests from external applications
Change-Id: Ideeb0b06b6c7fc792e2102eb71296e99f3023842
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-09 23:09:34 +00:00
Thiago Macieira
c3a4ec5d0b SIMD: Add a haswell sub-architecture selection to our support
As the comment says, Haswell is a nice divider and is a good
optimization target.

I'm using -march=core-avx2 instead of -march=haswell because the latter
form was only added to GCC 4.9 but we still support 4.7 and that has
support for AVX2.

This commit changes the AVX2-optimized code in QtGui to Haswell-
optimized instead. That means, for example, that qdrawhelper_avx2.cpp
can now use the FMA instructions.

Change-Id: If025d476890745368955fffd153129c1716ba006
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-07-09 00:18:24 +00:00
Frederik Gladhorn
23e20e4030 Add logging for QAccessibleCache
Change-Id: I2cbaf6c6dfb80b2b5c2732f1633da411fd816710
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-07-08 06:37:56 +00:00
Frederik Gladhorn
4fa12d8553 Fix deletion of items in QAccessibleCache
Items in the cache may be part of the parent/child hierarchy. Make sure
not to have dangling pointers in the cache, but rather cleanly remove
all interfaces that get deleted since they may delete each other (TabBar
deletes its child interfaces for example.

Task-number: QTBUG-69283
Change-Id: Iad17cd1d3356804b3d8cbba8632ec22b836c3521
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-07-08 06:37:48 +00:00
Tor Arne Vestbø
13337096f9 Re-enable QGradient::Preset documentation by explicitly ignoring warnings
Change-Id: Ibde6d905c74a571dc2e9d2942e99682e0a4f9b8c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-07-06 13:59:10 +00:00
Liang Qi
e3ed2281c0 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_dragging.mm
	src/plugins/platforms/ios/qiosinputcontext.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/tools/androiddeployqt/main.cpp
		Was moved from qttools into qtbase in 5.11.
		So re-apply 32398e4d here.
	tests/auto/corelib/global/qlogging/test/test.pro
	tests/auto/corelib/global/qlogging/tst_qlogging.cpp
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
	tests/auto/corelib/thread/qthreadstorage/test/test.pro
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qapplication/test/test.pro

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Done-with: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
2018-07-02 11:23:45 +02:00
Tuomas Heimonen
4b5afc788f QIntValidator: Intermediate for number if digits equal or less than max
Input value which is over the highest acceptable value, but consisting
of a number of digits equal to or less than the max value should be
considered intermediate.

[ChangeLog][QtGui][QIntValidator] Input value with over the highest
acceptable value, but with equal or less amount of digits than the maximum
value is now considered intermediate.

Task-number: QTBUG-59650
Change-Id: I71a77c9c266f0f3b62c71ac6cb995019385c1cf5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-06-29 09:17:05 +00:00
Giuseppe D'Angelo
ce6c4349f7 Tracepoints: refactor the existing tracepoint names
Use CamelCase, like the API they're tracing.

Change-Id: Ie718ab624d17c9186bcf05cc1276c8eccad7f454
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2018-06-28 20:40:40 +00:00
Tor Arne Vestbø
fb0271564d Fix wrongly included radial gradient enum for QGradient presets
Change-Id: If8372224d7e113c1f55468c0de69dcab9804138f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-28 15:20:02 +00:00
Eirik Aavitsland
e5b3db841d Fix: bad-looking scaled rendering of painterpath in OpenGL paint engine
For performance, the triangulation of a painter path is stored for
reuse. Re-triangulation was only done if the path was to be painted at
a significantly different scale AND it contained a curve (bezier)
element. But also the triangulation of a path with only straight lines
can lose precision if rendered at a small scale, and so look bad when
used at a higher scale factor.

Fix by removing the mentioned curve element condition.

Task-number: QTBUG-68873
Change-Id: Id3492514e9382a5828377b7bafea8cfac7b850a6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-06-28 14:28:53 +00:00
Eskil Abrahamsen Blomfeldt
bc71946487 Don't position cursor inside complex graphemes when clicking outside line
If you clicked to the right of a text line ended with a grapheme consisting of
several characters, either because it was a unicode surrogate pair or a ligature,
we would always to the previous character in logical order, without checking
if this was a valid cursor position.

One result of this would be that hitting backspace when the cursor was positioned
in an invalid position, would cause the entire contents of the document to
become invalid.

Instead we should search backwards for the previous grapheme boundary using
QTextEngine::previousLogicalPosition().

[ChangeLog][QtGui][Text] Fixed position of text cursor set by clicking outside
the bounds of a text line that ends with a surrogate pair or ligature.

Task-number: QTBUG-69085
Change-Id: I7224c065f332f398bdfbb3f42b2b3ec8280c76a4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-28 05:20:14 +00:00
Tor Arne Vestbø
465098088e Harden logic for converting from CSS gradients to QGradient
Some of the gradients from https://webgradients.com/ are not minified
completely, so we need to be a bit more lenient when converting them
to the internal format used by QGradient.

Change-Id: I47466b6a77abd6d2fefc1326fbf6ba5713dd74cb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-27 15:40:03 +00:00
Tor Arne Vestbø
fc926985a1 doc: Mark QGradient::Preset enum as internal until we can ignore its values
Change-Id: I0637ee765053a30ac3666f33c4d8f59c5ae9aa84
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-06-27 15:40:03 +00:00
Erik Verbruggen
74be42ca59 ItemModels: Cache last-known child index
Instead of caching the last index of a search for a child item, cache
the index of the child in the child item. When the item model is not
changed, the index is valid. Otherwise, the index can only change when
items get inserted or removed before the child. So in that case, start
searching in the vicinity of the previously known index.

As an example: a selectAll() on the view will always hit the cached
index, so no search is performed for any item in the model/view.

Task-number: QTBUG-61368
Change-Id: I85d085299987237fae23451d9e8bbb6060464ef2
Reviewed-by: David Faure <david.faure@kdab.com>
2018-06-27 10:01:07 +00:00
Erik Verbruggen
e3a1b18bc3 ItemModels: search for the child index in 2 directions
Previously, the search for the index of a child was done by searching
forwards (minus 2) from the last search, and subsequently backwards when
it wasn't found. This would cause quite some searching in models with
lots of items, and where the child lay before the last search.

We still assume that subsequent searches for children are "nearby" the
previous search, but instead of first searching forwards and then
backwards, do the search in both directions.

Task-number: QTBUG-61368
Change-Id: Idb549c2d02840632cd658f906816ce911f3ff8bc
Reviewed-by: David Faure <david.faure@kdab.com>
2018-06-27 10:01:02 +00:00
Paul Wicking
6f53c2bc96 Doc: Fix typo
Task-number: QTBUG-69093
Change-Id: Ica63482251b2a614a17a996fac9bcc16b96c200f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-26 12:56:04 +00:00
Eirik Aavitsland
0877ced980 Fix: crash when painting with high-dpr image brush
The recently merged f5fe9fc5a4 (Add ObjectMode to QGradient) changed
combineXForm() to check the brush's gradient's
coordinatemode. However, combineXForm() is now also used when painting
with high-dpr image brush. In the latter case, the gradient is 0 so
this would crash. Testcase: tst_lancelot, image_dpr.qps.

Change-Id: I5e2785ef708768c3fa3eac0999c9c24fd25108f4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-25 13:04:35 +00:00
Gatis Paeglis
7a7c722782 dnd: send DragEnter and DragMove on DnD start
This was a regression from Qt4 and also is the documented behavior.
In addition this patch fixes various issues with cursor shape updating
that were discovered along the way and that are necessary for testing
the new changes.

The code in QGuiApplicationPrivate::processDrag() also needed a fixup,
particularly the resetting of QGuiApplicationPrivate::currentDragWindow.
Without this fix we would get DragMove (the one that immediately follows
the DragEnter) only for the first DragEnter event. For example when dnd
starts on mouse press then for mouse click we would get:

<click> DragEnter->DragMove->DragLeave <click> DragEnter->DragLeave

but the expected is:

<click> DragEnter->DragMove->DragLeave <click> DragEnter->DragMove->DragLeave

Task-number: QTBUG-34331
Change-Id: I3cc96c87d1fd5d1342c7f6c9438802ab30076e9e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-06-25 12:45:47 +00:00
Kai Koehne
ca3460775c Fix incorrect JSON in qt_attribution.json
Fix spurious comma added in commit c4a21708ed.

Change-Id: I6d62378dfdda7a0da611eed1064cff707b9c6bf6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-25 12:39:27 +00:00
Thiago Macieira
cad7100fda QByteArray: add compare() with case sensitivity options
Need to do the same for startsWith() and endsWith(). indexOf() is a lot
harder.

[ChangeLog][QtCore][QByteArray] Added compare(), which takes
Qt::CaseSensitivity as one of the parameters. This function is more
efficient than using toLower() or toUpper() and then comparing.

Change-Id: Ib48364abee9f464c96c6fffd152e69bde4194df7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-22 20:12:41 +00:00
Eirik Aavitsland
f5fe9fc5a4 Add ObjectMode coordinate mode to QGradient
The ObjectBoundingMode coordinate mode of QGradient allows specifying
the gradient coordinates relative to the object being painted. But if
the gradient brush also has a transformation, that transformation is
applied in the logical, not object, coordinate space. That behavior is
counterintuitive. However, changing it now would break existing
code. Instead, we introduce a new coordinate mode enum with the
expected behavior, and document the old one as deprecated.

This prepares to fix the bugs below in qtsvg, by making
it possible to specify the same behavior in Qt as SVG has.

[ChangeLog][QtGui][QGradient] Add ObjectMode coordinate mode
[ChangeLog][Important Behavior Changes] QDataStream version bumped up to 18 to account for changes in the serialization of QGradient.

Task-number: QTBUG-59978
Task-number: QTBUG-67995
Change-Id: I8820a2555359812f3e1a46e37d6ac2cc29a2091d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-22 10:42:33 +00:00
Giuseppe D'Angelo
67776febd5 Fix the qHash implementation for QMatrix / QTransform
The order of the arguments of QHashCombine::operator() was
accidentally swapped -- the first is supposed to be the
accumlated value, the second the new value to combine.

[ChangeLog][QtGui][QMatrix] The qHash() implementation for
QMatrix has been changed.

[ChangeLog][QtGui][QTransform] The qHash() implementation for
QTransform has been changed.

Change-Id: Iba13f76ff734a2184c96184ee0e5748c05db07fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-21 20:31:23 +00:00
Paul Wicking
8bd73ad989 Doc: Add missing full stops in briefs
Task-number: QTBUG-68933
Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-21 14:23:30 +00:00
Qt Forward Merge Bot
8eabb44f8a Merge remote-tracking branch 'origin/5.11.1' into 5.11
Change-Id: I9a4571ccf826a86e055dfbba23b5e5cbd8ea55e8
2018-06-19 13:12:48 +02:00
Oswald Buddenhagen
eaa3417901 configure: dequote library sources asap
the json format uses single strings for library sources, as that leads
to less noisy source text. however, this implies the need for de-quoting
and subsequent re-quoting whenever the values are processed. so change
the internal representation to regular qmake string lists as the first
thing when processing the lib source, and re-quote only when outputting
the values.

CFLAGS are excluded, because we'll deal with them differently.

Change-Id: I4ab43d98085ea9f6601fd21ac2afb5bce4f7e2a9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-12 10:03:32 +00:00
Liang Qi
49c9377421 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-06-08 07:46:35 +00:00
Liang Qi
096e37910d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/kernel/qeventdispatcher_cf.mm
	src/gui/kernel/qguiapplication_p.h
	src/gui/kernel/qwindowsysteminterface.cpp
	src/gui/kernel/qwindowsysteminterface.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/qioseventdispatcher.mm
	src/plugins/platforms/windows/qwindowsdrag.h
	src/plugins/platforms/windows/qwindowsinternalmimedata.h
	src/plugins/platforms/windows/qwindowsmime.cpp
	src/plugins/platforms/winrt/qwinrtscreen.cpp

Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
2018-06-07 19:10:53 +02:00
Oswald Buddenhagen
fc5da399c3 Merge 5.11 into 5.11.1
Change-Id: I28f48e980a9e23ddde5251608dd9d1d83df65392
2018-06-07 17:10:57 +02:00
Allan Sandfeld Jensen
c6b3f4b282 Fix black border around main widget with non-integer scaling
All the other highdpi scaling uses rounding, and not using it here may
offset the compositing by a line.

Task-number: QTBUG-67994
Change-Id: I2f5f328c091d0e85c40b1663e22c82f364df65e5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-07 11:19:04 +00:00
Allan Sandfeld Jensen
95e6ab3329 Optimize fetchTransformed and removed specialized versions
Optimize the general transformed fetcher and use it to replace several
specialized copies of it that are now slower than the general one.

Change-Id: Ife79ec99227f0df4f127303c7a340b2f7d174dff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-06-07 10:37:43 +00:00
Allan Sandfeld Jensen
b46cb00fc0 Handle negative leading in layout
Adjust line positions to deal with negative leading which isn't included
in height of QTextLine.

Change-Id: Id7918968c0f9d7e65700b9e7a08fc5d761883f22
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-06 16:59:31 +00:00
Andre de la Rocha
b72a9cbaaf Fix PDF rendering of strokes with cosmetic pens
The PDF backend was ignoring the cosmetic attribute for certain pens,
resulting in strokes rendered incorrectly.

Task-number: QTBUG-68537
Change-Id: Ib9fd5a510716056c8afe67733f51fc682bbb7354
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-06-06 16:54:20 +00:00
Liang Qi
62abbe34b8 Fix build for Android with android-clang in r17
Task-number: QTBUG-67464
Change-Id: Ib971a5da82b31bce9ac1c9ac623ad7d5302cfaec
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-06 11:36:33 +00:00
Allan Sandfeld Jensen
8c33b79823 Fix HDR format in QOpenGLFramebufferObject::toImage()
If the fbo had samples > 0 set, it would use a temporary fbo with
a default configuration losing the HDR precision.

Change-Id: I7e9966165b3100f148c4ad24738f3ee71273f29a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-06-06 10:48:36 +00:00
Eirik Aavitsland
d9d77e8680 Fix QTransform::transposed() result having wrong transformation type
The implementation of QTransform::transposed() had a wrong assumption
about the type of the result.

Task-number: QTBUG-68630
Change-Id: Ia5ce794efe773d74fb5fdaff3da8cae2b452e7e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-06 08:59:20 +00:00
Johan Klokkhammer Helsing
36d2ef5af9 Ignore XDG_SESSION_TYPE=wayland on gnome-shell
[ChangeLog][Wayland] In Qt 5.11.0, support for selecting a platform plugin based
on the XDG_SESSION_TYPE environment variable was added. On gnome-shell, however,
bugs—in both Qt and gnome-shell—made many widget applications almost unusable.
So until those bugs are fixed XDG_SESSION_TYPE=wayland is now ignored on
gnome-shell.

Task-number: QTBUG-68619
Change-Id: I902acd1c4fc996f46e8431c12c0a5cdbab883abf
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-05 13:10:45 +00:00
Martin Smith
e3e0a6d6d6 doc: Document Qt namespace in multiple modules
qdoc didn't handle this. This update fixes most of what was wrong,
but tuning the details of the namespace reference pages might follw.
We have namespace Qt as an exaqmple. Most of the elements in the Qt
namespace are in QtCore, but a few functions are declared in QtGui.
Before this update, qdoc used the hack of using #ifdef to remove the
declarations from qtextdocument.h in QtGui and .cpp and then added
them back into qtnamespace.h and .cpp in QtCore.

Now that hack is no longer necessary. The functions in the Qt namespace
that are declared in QtGui are documented there, but the documentation
is linked to from the namespace reference page, which remains in QtCore.
That is, only one \namespace command is used to document the Qt namespace,
and it appears in qnamespace.qdoc where it always did, but the documentation
for the Qt namespace functions declared in QtGui is now appears in
qtextdocument.cpp where it belongs.

Change-Id: Ic5888875c3b8310a3dba244475e2a6c3bc0c1808
Task-number: QTBUG-67267
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-01 16:38:01 +00:00
Tor Arne Vestbø
c4a21708ed Provide presets for QGradient
Similar to Qt::GlobalColor, the presets allow the user to create
brushes based on predefined gradients, quickly getting pretty pixels
on screen.

The presets are based on the linear gradients from WebGradients, a
free collection of gradients, hosted at https://webgradients.com/.
The few radial and blended gradient presets have been excluded.

Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-31 15:50:50 +00:00
Allan Sandfeld Jensen
ffc377a529 Reduce recent performance regression
The change to fix 16-bit integer overflow used two floor operations
when only one is necessary. With floor being rather expensive on x86
without SSE4.1 this caused a performance regression in ARGB32
smooth perspective transforms.

This eliminates one of the floor operations which is unnecessary as the
number is always positive in this case and thus truncation will yield
the same result faster.

Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-30 08:28:41 +00:00
Laszlo Agocs
6a14608742 QOpenGLTexture: Enable multisample 2D textures on GLES 3.1+
Task-number: QTBUG-68510
Change-Id: Ib224189906b595bbae5aab95c888dd13e94171aa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-05-30 07:53:15 +00:00
Joerg Bornemann
9f27bfb31a Make sure we can build with -no-feature-draganddrop
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.

Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-29 18:31:35 +00:00
Liang Qi
f82e508516 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	mkspecs/features/qt_common.prf
	src/corelib/tools/qstring.cpp
	src/plugins/platforms/windows/qwindowsmousehandler.cpp
	src/widgets/widgets/qmainwindowlayout_p.h

Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
2018-05-24 16:29:14 +02:00
Allan Sandfeld Jensen
b9bc6c31a0 Fix potential 16-bit integer overflow
When multiplying a float in [0;1[ with (1<<16), with rounding, it might
end up being rounded to 65536 even if the input was under 1. This patch
uses a floor operation to make sure the value can be in a ushort, and
cleans up the surrounding code so it is clearer what it does.

Task-number: QTBUG-68360
Change-Id: I2d566586765db3d68e8e7e5fb2fd1df20dabd922
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-23 13:26:57 +00:00
Allan Sandfeld Jensen
bd74b624d5 Improve bounding rect of QStaticText with Qt::PlainText
The bounding rect was not including positive leading of the last line. This
patch solves it by changing using QTextLine's setLeadingIncluded, and adds
handling of negative leading to keep rendering unchanged in that case.

Change-Id: I4d18b81892184bb85cd7949a5dc3fb9cfa270a26
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-05-23 09:52:30 +00:00
Allan Sandfeld Jensen
dfa434a979 Optimize unpremultiply using SSE rcp
Change-Id: I255031d354b0fde7abe8366ea2c86a35f9f24afd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-23 08:31:07 +00:00
Allan Sandfeld Jensen
8f6f9cbaa9 Reapply SSE4 acceleration to ARGB32->ARGB32PM conversion
After the merger of fetch and convert, we were missing the hook
to the accelerated merged version of ARGB32->ARGB32PM conversion,
causing a minor performance regression.

Change-Id: I3965d1a95f2305306005db09640f2775aa645d2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-20 09:03:19 +00:00
Friedemann Kleint
24d7a2229d Documentation: Fix URLs to GL(ES) functions
Replace the XML pages which are typically displayed as broken
by the XTHML pages. Strip some suffixes.

Change-Id: Idf2b9706f169484c659582a1a2d38904d5dd81aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-05-18 08:45:21 +00:00
Friedemann Kleint
811db6262f qpixmap_win.cpp: Silence clang-cl warnings
Introduce nullptr, C++ casts, fix deprecation warnings
and fix some signedness issues.

Amends 2268b6bcdd.

Task-number: QTBUG-51124
Task-number: QTBUG-63512
Change-Id: If371d3b71658258b7238c7eb0b11ac4a1ae0d1b6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-16 08:23:50 +00:00
Eirik Aavitsland
9c1290cecb Doc: add explanation of return format of QImage::transformed()
QImage::transformed() can sometimes return an image with a different
image format than the original. This might be unexpected, so explain
it in the doc.

Task-number: QTBUG-50087
Change-Id: I165fc7b44439b770b542be52d3108fd70bf0ae99
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-11 10:31:01 +00:00
Morten Johan Sørvig
ee60a044c9 macOS: Add QSurfaceType::MetalSurface
Add API to activate previously added Metal layer implementation.
This provides minimal support, and unlike VulkanSurface
there is no separate QWindow subclass.

What this does do is configure the QWindow to use a
Metal layer, and to send expose/update events when
the layer content should be redrawn. Qt will also update
the layer’s drawableSize and contentsScale when needed.

Application code can make use of this by accessing
the QWindow layer, which will be a CAMetalLayer:

  CAMetalLayer *metalLayer = reinterpret_cast<CAMetalLayer *>(
    reinterpret_cast<NSView *>(window->winId()).layer);

Change-Id: I514f5186133c3e610fd4e53ca91fe9c85c6d016e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-11 09:13:55 +00:00
Gatis Paeglis
23d760d96f Revert "qbasicdrag: temporary restore obsolete APIs"
This reverts commit 0b815aa2f8.
Inter-module compile issues have been resolved now, see
qtwayland/44f3b888a3f88ac8097ff65aec0101dbe6a369ef.

Change-Id: I7f9ed4f9d5f0d6431493a8f47ffe8a85141f0e50
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-05-09 07:49:30 +00:00
Liang Qi
b5a956601f Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
	tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro

Change-Id: I3169f709cc2a1b75007cb23c02c4c79b74feeb04
2018-05-08 20:43:45 +02:00
Friedemann Kleint
09d4faa008 QtGui: Enable synchronous delivery for QWSysIf:::WindowScreenChangedEvent
Task-number: QTBUG-67777
Change-Id: I6d52b650fb33283010ef06259da83cdb2fd3483f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-08 09:22:03 +00:00
Gatis Paeglis
0b815aa2f8 qbasicdrag: temporary restore obsolete APIs
... that were removed in 10b3286313.

This is needed so we can properly resolved inter module
dependencies (update qtwayland to use the new API).

Task-number: QTBUG-68151
Change-Id: If9c3b42f76bd2c1d8fc86304cfcc22c18bad9e27
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-05-08 07:36:49 +00:00
Allan Sandfeld Jensen
910785a77a Get rid of argb32->argb32pm routines in qimage
We already have better optimized versions in drawhelper. Removing
these versions is a performance gain.

Change-Id: I431c74e440529648d9bc5e22c0e700a72d376934
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-07 17:59:31 +00:00
Allan Sandfeld Jensen
a18370cbed Optimize intermediate_adder_avx2
Use 16-bit multiplication as it is twice as fast as 32-bit
multiplication.

Change-Id: I64b529eaaed4ce2c59c64a0120e93cd132724156
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-07 15:22:36 +00:00
Mitch Curtis
f72777b969 QShortcutMap: print ambiguous shortcuts when DEBUG_QSHORTCUTMAP is defined
This is useful to see why shortcuts (in Qt Widgets and Qt Quick) are
not behaving as expected. For example:

    The following shortcuts are about to be activated ambiguously:
    - QKeySequence("Esc") (belonging to QQuickShortcut(0x7fcd4c8e6a70,
        name = "exploreViewBackOrCloseShortcut"))
    - QKeySequence("Esc") (belonging to QQuickPopupItem(0x7fcd4c8e5110))

Change-Id: Id20a3017d69cfe417c2286dccf46b3d5ff0b31b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-07 12:03:26 +00:00
Allan Sandfeld Jensen
9bc616948f Optimize direct argb32 blend functions
They were slower than the long path version due to working too hard.
This also unduplicates code by using the blend_pixel function.

Change-Id: Ibf84b8f749cf40d4c852b459dc76860afd850d32
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-07 12:00:06 +00:00
Tor Arne Vestbø
4d15f393a7 Move default implementation of update requests to QPlatformWindow
Change-Id: I4cbb8d2023068288e298ab21f5cd8bc258825c77
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-07 10:43:16 +00:00
Frederik Gladhorn
1e9da7b3fd Accessibility: Fix leaking cached interfaces
When the application closes, we should clear the cache to not run into
memory sanitizers claiming that we leak.

Change-Id: Ibf9fcda107be6b7f3ed414d7651080aa1f61a3a5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-05-04 10:56:35 +00:00
Gatis Paeglis
10b3286313 qpa: improve API to support DnDs from other processes
... instead of using a hack of directly accessing QGuiApplication
members.

The current QPA API was bad for two reasons:

1) It expects platform plugin authors to know about
internals of Qt Gui, particularly that QGuiApplication
uses QGuiApplication::{mouseButtons,keyboardModifiers}
to construct QDragMoveEvent and QDropEvent events. Which
results in the second reason why this is bad.

2) Platform plugins should not directly access member
variables of QGuiApplication, just to make sure that
QDragMoveEvent and QDropEvent events contain correct state.
Platform plugins should instead use QWindowSystemInterface
to communicate with Qt Gui (which is also the solution here).

The solution is to extend QWindowSystemInterface::handle{Drag,Drop}
to require mouse/keyboard state. We already do this for
some of the other methods, so it is nothing extraordinary.
This type of interface is also _required_ to support
drag-n-drops from other processes. We can't use
QGuiApplication::{mouseButtons,keyboardModifiers} when the
drag originates from another process, instead we need to
query mouse/keyboard state from the system.

This patch fixes drag-n-drops from others processes on XCB
platform plugin.

Task-number: QTBUG-57168
Change-Id: I3f8b0d2f76e9a32ae157622fef801829d629921d
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-04 10:44:15 +00:00
Filipe Azevedo
ebd3a13b80 Add a QPalette color role for placeholder texts
This allow to customize easily placeholders in QLineEdit by example.

Change-Id: I2bb379164376e1d88b42d6c86c2e5b8df99fbc56
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-04 08:53:06 +00:00
Eskil Abrahamsen Blomfeldt
e28ae083d2 macOS: Fix stretch of condensed fonts with NoFontMerging
When showing a condensed font with AnyStretch, we should
not apply any stretch to the font (and if a stretch is
requested, we should calculate the actual stretch based
on how much the font is already stretched or condensed).

This usually works as expected, however, when using
QFont::NoFontMerging as the style strategy, we would
scale the glyph advances by the stretch of the font
since the calculated stretch of the font engine would
be overwritten by the actual stretch. In the case where
we use font merging, this would be done for the multi
engine, so we would not get the same issue, since the
text engine gets the stretch from the actual font engine
and this still has the original, calculated stretch
set.

Note on the test: We can't use testString() for this,
since it contains a space, and the test font does not
have a glyph for this, so we will end up merging a
different font for the space, giving us a slightly
different advance.

[ChangeLog][QtGui][macOS] Fixed display of condensed fonts
when NoFontMerging is in use.

Task-number: QTBUG-63800
Change-Id: I5b05e0dbfc8ae4b5d10c621ecb0975f53fda9483
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-04 04:46:48 +00:00
Gabriel de Dietrich
8447f5f006 QShortcut: Try harder to find a widget for parentless menubars
Add QPlatformMenuBar::parentWindow(). Since we call handleReparent()
every so often, it's reasonable to be able to get its value back.

While this parent window won't give us much information from
the point of view of the actual QWidget parent for the menubar,
the main reason we will need this is to check for modality blockage.
Indeed, QApplicationPrivate::tryModalHelper() only cares about the
widget's window since modality blockage is decided at the window level.

Change-Id: Ie79f483424b01e430bc9168ba82489e30d15aec6
Task-number: QTBUG-67938
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-05-03 22:51:01 +00:00
Liang Qi
60fefff22f Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
	examples/widgets/graphicsview/elasticnodes/node.cpp
	examples/widgets/graphicsview/elasticnodes/node.h
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_drawing.mm
	src/widgets/kernel/qmacgesturerecognizer_p.h

Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
2018-05-03 14:50:22 +02:00
Allan Sandfeld Jensen
648ee7aa02 Merge drawhelper convert-from and store
Avoids using an intermediate buffer on store and simplifies the code.

Change-Id: I2dc4e735eb770f90dc99fe0f513b4df3b35ee793
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-02 14:20:55 +00:00
Karim Pinter
2803cdf758 Fix for mouse with modifiers handling
Modifier keys are saved in qinputdevicemanager such way that both evdev
and libinput can use it the same way, it is also handling the repeating
modifier key events. Evdev support is important for VxWorks support
because it is using it.

Task-number: QTBUG-60694
Change-Id: I49038cb7fe2ad5134b3a37167c19953867ea31c3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-05-02 10:41:43 +00:00
Liang Qi
b3ebe8713b Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-04-26 15:53:08 +00:00
Morten Johan Sørvig
7160df3a15 High-dpi drawTiledPixmap (raster paint engine)
Implement more consistent behavior for drawTiledPixmap(),
which should produce the same visual tiling pattern
independent of display devicePixelRatio

Consider the following pixmaps and draw calls:

  QPixmap px32; // 32x32
  QPixmap px64; // 64x64
  drawTiledPixmap(QRect(0, 0, 128, 128), px32);
  drawTiledPixmap(QRect(0, 0, 128, 128), px64);

On 1x displays this will produce 4x4 and 2x2 tiles,
respectively.

On 2x displays this would previously produce a different
tiling pattern, where the paint engine would tile in
the device pixel coordinate system. Change this to
tile in the device independent coordinate system,
producing the same visual tiling pattern as the 1x case.

It is possible to produce a 4x4 tiling pattern with
high-resolution output from the 64x64 pixmap by setting
the devicePixelRatio:

  QPixmap px64;
  px64.setDevicePixelRatio(2);
  drawTiledPixmap(QRect(0, 0, 128, 128), px64);

This change adds an inverse scale to the image filler
transform that accounts for the pixmap devicePixelRatio.

[ChangeLog][QtGui] QPainter::drawTiledPixmap() now
tiles in the device independent coordinate system.

Change-Id: I4918d274192967f222f181b374571c7c597dcd76
Reviewed-by: Jonathan Courtois <jonathan.courtois@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: 石博文 <sbw@sbw.so>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-26 10:39:25 +00:00
Liang Qi
866b47916d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
2018-04-26 09:55:10 +02:00
Eirik Aavitsland
bd1fd197ca Fix drawTiledPixmap() and texture-brush painting with high-DPR images
Although QPainter::drawImage()/drawPixmap() would render images scaled
according to their devicePixelRatio(), that would not happen for
drawTiledPixmap() and when using a textured brush. Implemented here,
in combination with the pending "High-dpi drawTiledPixmap (raster
paint engine)" commit.

[ChangeLog][QtGui] Fix drawTiledPixmap() and texture-brush painting with high-DPR images

Task-number: QTBUG-67248
Change-Id: I037e3f897fa708038a0222d3b0c61c7842d87961
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-04-25 13:39:28 +00:00
Allan Sandfeld Jensen
18db0b49c6 Don't crash on <br> following a <table>
A <br> has a new-line but no text, so be able to handle no lines.

Task-number: QTBUG-60853
Change-Id: I3d4dbd529114bbe8afe760c3622b52446202ec7c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-04-25 07:08:50 +00:00
Allan Sandfeld Jensen
e413874467 Fix division by zero in radial gradiants with NEON
The NEON implementation uses rsqrt and thus can not be taken on 0, so
replace the minimum with something close to zero instead of zero.

Task-number: QTBUG-59961
Change-Id: Ia39e45be675b056c1e22900495ce9ba4e8b70e5f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-04-24 18:16:54 +00:00
Daniel Savi
84eb9b5e30 Add image quality handling to QTextImageFormat
This patch enhances QTextImageFormat with a property for image quality.
Default will be quality of 100. The user may set different values with
setQuality(int). QTextODFexport will export images as png if quality is
set to 100 and as jpg with the compression quality set to the given value
if smaller than 100.

[ChangeLog][QtGui][QTextImageFormat] Adds two new functions to the class:
setQuality(int=100) and quality(). Is currently used by QTextODFWriter to
determine the image type and quality when exporting images to ODT files.

Change-Id: Iaa8ec0246aaba004d98c9e8c66609795101519a9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-22 12:47:26 +00:00
Andy Shaw
0b70f5ada9 QDoubleValidator: Allow intermediate values as close as possible to one considered invalid
The documentation states that if you have a range of
0.00-2.00 with the number of decimals set to 2 then
any number up to 9.99 would be considered intermediate.
This is because the number of digits still matches both before
and after the decimal point. If it is 10.0 or 9.999 then
it is still considered invalid.

In the case of 9.999 being invalid in this case, the documentation
is corrected as this was incorrectly indicated as Intermediate,
as the code indicates it as Invalid.

Change-Id: I07b433e856f355916a1240deafdf4ef58e680639
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-04-17 15:36:34 +00:00
Tor Arne Vestbø
49b4433adf Provide QPlatformWindow::hasPendingUpdateRequest() helper function
So that platform plugins don't need to dive into QWindowPrivate.

Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-17 12:55:06 +00:00
Qt Forward Merge Bot
4aa6f54fec Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
2018-04-15 01:00:18 +02:00
Akihito Izawa
26355be54d QStyleHints: emit correct signal when calling setMouseQuickSelectionThreshold
Change-Id: Ieb76ecc406c25ca11a108775ebd46a8e597401b5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-04-13 06:33:35 +00:00
Eirik Aavitsland
ca58764da1 PDF engine: handle abnormally long string cases
The output routine used a fixed size scratch buffer, with no attempt
to handle overrun. Add a simple fallback code path for such (extremely
rare) cases.

Task-number: QTBUG-66788
Change-Id: I52531b829baeaa48a8fb5a637a020ee9f89d270a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-12 21:22:41 +00:00
Eirik Aavitsland
7f782e1fc4 Fix crash if QPixmap::defaultDepth() is called when no QGuiApplication
This static method can be called before QGuiApplication is created. At
that point there is yet no primary screen, so the implementation
needs to guard against dereferencing a nullptr.

Task-number: QTBUG-67309
Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-12 21:22:20 +00:00
Lars Knoll
4f158ccee5 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
2018-04-12 22:00:35 +02:00
Daniel Savi
6a4b6971f4 Add more formatting to QTextDocumentWriter when writing ODF files
QTextDocumentWriter only supports a small subset of table formatting
when exporting to ODF-format. This patch adds more formatting
capabilities to the ODF exporter:
- table border support
- table alignment
- table width
- respect column constraints (column widths)
- add a tab before soft line breaks. This will avoid causing the last
line to stretch all over the cell in justified paragraphs.

With this patch, line height settings are now exported, too.

[ChangeLog][QtGui][QDocumentWriter] QDocumentWriter now supports table
borders, table alignment, table width, column widths, line height and
image resolution when exporting QTextDocuments to ODF files.

Task-number: QTBUG-63581
Change-Id: I2d269ef0f842e73af64d48bfef531d5fa3078088
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-11 18:44:31 +00:00
Allan Sandfeld Jensen
4b6542c9ff Remove last uses of interpolate_4_pixels_16 on SSE2 and NEON
With SSE2 or NEON interpolate_4_pixels is faster than
interpolate_4_pixels_16, and using it saves a branch of duplicated code.

Similar changes had already been done other places it was used, those
have been updated to follow a similar logic.

Change-Id: I040d96480f7f925f659602f66f931d28b59312a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-11 07:53:53 +00:00
Liang Qi
093290a662 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/ios/quiview.mm

Change-Id: I0fd0adeca1590fffddd577873172f6d987a60412
2018-04-11 09:34:23 +02:00
Juan Jose Casafranca
95c8f24b71 Enable BuiltIn input in the shader graph builder
BuiltIn inputs shouldnt be translated into a code input. We comment the
input line for this variables

Change-Id: I3b7d2fd06afc6a122d90a999fc5a5246fc93234e
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2018-04-10 23:49:37 +00:00
Oswald Buddenhagen
436a6fbb83 configure: make plain -xcb switch effective
the option is a quad enum, with "yes" meaning "either system or qt". the
distinction is made only in the "system-xcb" feature, while "xcb" itself
must be forced on in the "yes" case.

Task-number: QTBUG-67251
Change-Id: Ib706e79a902ae0f1b64ca6d4611c9214b7b7e928
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-10 18:51:18 +00:00
Christian Ehrlicher
c7cbf21699 QPixmapCache: make sure to not overflow cache limit
The cost for the pixmap cache was calculated in bytes but
setCacheLimit() takes the size in kilobytes. This lead to the
situation that all values above 2097152 overflowed and disabled
the caching completely. Fix it by calculating the cost in
kilobytes as it is done in QGLContext.

Task-number: QTBUG-45293
Change-Id: Ib8dc2360c8f3201ce0b615a04c38b5ccaa8fc6cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-04-10 18:45:27 +00:00
Friedemann Kleint
2268b6bcdd QtGui: Add qt_imageToWinHBITMAP(), qt_imageFromWinHBITMAP()
Add functions for converting QImage to HBITMAP and back
supporting additional formats of QImage (RGB888, RGB555,
Indexed8 and Mono). Add test with roundtrip to tst_qimage similar
to tst_QPixmap::toWinHBITMAP().

Task-number: QTBUG-51124
Change-Id: Ib568898e7162686bfa527d828785628eb0b78e21
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-10 12:20:45 +00:00
Qt Forward Merge Bot
e027c7241f Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I0120f804522c0c652e9537b6e9fe08189f071ed2
2018-04-10 01:00:26 +02:00
Mikhail Svetkin
f5a624c9b9 Fix integer overflow (1 << 31)
On platforms where integer by default is int32(max is 2147483647) and
(1 << 31) will be 2147483648

Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-09 08:40:29 +00:00
Qt Forward Merge Bot
8001195098 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Idf2bef470663864069bbf7e41af07b534936863a
2018-04-07 01:00:14 +02:00
Johan Klokkhammer Helsing
fbb9c0461c QOpenGLTexture: Set wrap mode if NPOT textures are not fully supported
The OpenGL wrap mode defaults to GL_REPEAT although it is not supported for
non-power-of-two textures on hardware that only has limited support.

I.e. the following would create a texture with an invalid wrap mode:

    auto *t = new QOpenGLTexture(QOpenGLTexture::Target2D);
    t.setSize(123, 456);

This patch adds a check in QOpenGLWindow::setSize to see if it's called with a
non-power-of-two size on hardware without full support, and if so sets wrapMode
to ClampToEdge (which should work on devices with limited support).

Task-number: QTBUG-67418
Change-Id: I56e9f4383dbf5430c2bc5e4e9e585712b3603c13
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-06 12:47:11 +00:00
Andy Shaw
d90fb72c20 Pass on local html links with a fragment to openUrl()
If a file link to a html file has a fragment part included then this
will be lost when passed to QDesktopServices::openUrl() as this is not
kept in the conversion of the QUrl. So by checking the filename in the
case of a fragment existing in the url, we can be sure that the
information is passed on correctly for html files.

Task-number: QTBUG-14460
Change-Id: I8167d8c164713dd999603ba9e74150f4f1a4abea
Reviewed-by: David Faure <david.faure@kdab.com>
2018-04-06 12:45:02 +00:00