Commit Graph

37058 Commits

Author SHA1 Message Date
Oliver Wolff
e05dc08ba0 winrt: Implement QPlatformCursor::setPos
Additionally to setting the cursor position we have to make sure that
enter and leave events are triggered. As WinRT at the moment only supports
maximized/fullscreen native top level widgets, an enter or leave event has
to be triggered, every time the cursor enters or leaves the core window.
Same as is done on Windows desktop an enter event is immediately followed
by a move event even for emulated mouse events.

Change-Id: I4b9a7b07f8e24b7887619f96979a064d933788aa
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-08-06 05:24:35 +00:00
Alessandro Portale
01e57909d4 Add a few overrides in Qt Core
Clang-tidy says:
  warning: annotate this function with 'override' or (rarely) 'final'
  [modernize-use-override]

Change-Id: Ic2304cf35f4132ba1f55714493db93836f8b413d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-05 18:56:58 +00:00
Thiago Macieira
f8dba7ac01 tst_QSharedPointer: raise the timeout for running qmake and makespec
We had 30s and 60s only, which isn'tenough for the Qt CI.

Task-number: QTBUG-69741
Change-Id: I00e04a465fcf4fc1a462fffd154782999e84ef8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-04 23:26:24 +00:00
Tor Arne Vestbø
b3da7494ba macOS: Don't make QCocoaGLContext current unless we have a drawable
Change-Id: I12ac982aa977c69af936f503369c91bac88492a9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-04 19:59:38 +00:00
Tor Arne Vestbø
c5a5d270e4 macOS: Modernize and clean up QCocoaGLContext::updateSurfaceFormat()
The updateFormatFromContext function that read GL state has been
merged into updateSurfaceFormat(), we're using AppKit classes
and functions instead of Core GL, and the logic has been simplified
by using attribute/parameter helpers.

Change-Id: Iec6717f457a0b4dbc8e34c3e15fcbcc42895b23e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-04 19:59:38 +00:00
Tor Arne Vestbø
80d536e9aa macOS: Add note about high-resolution workaround in QCocoaGLContext::makeCurrent
Change-Id: I0b82ef95c1a058586e8005665e1e2cab3f975833
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-04 19:59:37 +00:00
Tor Arne Vestbø
fa455b4c60 macOS: Simplify and clean up QCocoaGLContext constructor
Change-Id: Ie16256282784926506355012a735511b98118614
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-04 19:59:37 +00:00
Tor Arne Vestbø
1d42241d37 macOS: Clean up and rename QCocoaGLContext::pixelFormatForSurfaceFormat()
Change-Id: I1a439d8cec950cb23c977eedfcc1b8810c6cd1c5
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-04 19:59:37 +00:00
Christian Ehrlicher
85357472d0 QToolTip::mouseMoveEvent(): always call base class
QLabel::mouseMoveEvent() only called the base class implementation when
a rect was given to showText which could lead to inconsistent behavior.

Change-Id: I3e537ba5ae7c3c67715975624d1ee9f0c04fa9a7
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-04 19:31:37 +00:00
Christian Ehrlicher
5944c2503c QAbstractItemDelegate: only handle as json when type is QMetaType::QJsonValue
Only handle QVariants which has the type QMetaType::QJsonValue as json
values. Otherwise other types like e.g. QMetaType::Long/LongLong will
also be converted to a QJsonValue and maybe end up being displayed in
scientific notation.

Task-number: QTBUG-65082
Change-Id: I5d6458cd7e48fec262cda00b584a1a3c45404400
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-04 19:31:28 +00:00
Christian Ehrlicher
faff43348b QHeaderView: respect min/maxSectionSize in setDefaultSectionSize()
The min/max section size was not checked when setting the default
section size. This was an oversight when the check for min/max section
size was added to resizeSection().

[ChangeLog][QtWidgets][QHeaderView] setDefaultSectionSize() now
checks if the given value is inside min/max section size

Task-number: QTBUG-69431
Change-Id: I1b5704282927ce5a8520f52174ebf91d9840bc8a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-08-04 19:31:15 +00:00
Thiago Macieira
64a560d977 QObject: do allow setProperty() to change the type of the property
[ChangeLog][QtCore][QObject] Fixed a bug in setProperty() that caused a
property change not to take effect if the old value compared equal using
QVariant's equality operator, but the values were not strictly equal.

Task-number: QTBUG-69744
Change-Id: I00e04a465fcf4fc1a462fffd1547885861a07a64
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-08-04 15:46:02 +00:00
Tor Arne Vestbø
f29c955483 Blacklist flaky tst_QSpinBox::stepModifierPressAndHold on OpenSUSE
Task-number: QTBUG-69492
Change-Id: Ic24bad5a6b0c085e82f95e0b418d4d57405de4ea
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-04 13:45:42 +00:00
Thiago Macieira
4c22350278 Remove the src/sql/README.module file
It's stale. Thanks to Olivier B. for pointing out.

Change-Id: Ie01831ddac5446fdbdeefffd15463530818cff9e
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-04 06:08:50 +00:00
Tor Arne Vestbø
881078d7b5 macOS: Disambiguate use of native handles in QCocoaGLContext
We only need the QVariant native handle when creating the context, so
there's no need for a getter, and we then rename the NSOpenGLContext
getter to match e.g. QCocoaScreen::nativeScreen().

Change-Id: I041e0eff39af9c8836d8ecd560ea07e92dc63e03
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 22:50:23 +00:00
Tor Arne Vestbø
fed7876e20 macOS: Remove GL defines from QCocoaGLContext
They should be available in all SDKs we build against and support.

Change-Id: I799492e0b21a877717fb3a8391bcbad0f8581628
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 22:50:23 +00:00
Tor Arne Vestbø
f09b0337d7 macOS: Don't mess with native handle for QOpenGLContext
QOpenGLContext::setNativeHandle() is documented as:

 "configuration settings, like format(), are ignored since this
  QOpenGLContext will wrap an already created native context"

We should respect this and not apply QT_MAC_OPENGL_SURFACE_ORDER.

Change-Id: Idfdf3eac0e9f9d0a86f1b23aa475c3e4f12127e2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 22:50:23 +00:00
Tor Arne Vestbø
137e6c8277 macOS: Remove unneeded auto-release-pools in QCocoaGLContext
The makeCurrent one was not explained in the commit message that introduced
it, and doesn't make any sense, while the constructor one is no longer needed.

Change-Id: I67e2f2aaff5d8602781b27f122f415068a1f2301
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 22:50:22 +00:00
Tor Arne Vestbø
51451ea269 macOS: Add more logging to QCocoaGLContext
Change-Id: I6e93934b466f86b7607c9ad30c4c28a9c0f40fd7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 22:50:22 +00:00
Tor Arne Vestbø
f8b17a297e macOS: Propagate [NSOpenGLContext setView:] failures
Instead of trying to mask situations where [NSOpenGLContext setView:]
will fail (such as calling it for a view that's not part of a window
yet, or part of a window that hasn't been shown), we report the error
up through the API, so that QOpenGLContext::makeCurrent() will return
false. This is documented to occur e.g. when "the surface is not exposed,
or the graphics hardware is not available due to e.g. the application
being suspended."

QGLWidget was taught how to deal with this situation in cc27a50e. Other
Qt APIs seem to handle it fine, but if regressions occur they should be
fixable though the same logic as in cc27a50e.

Change-Id: I92775fc165444696b6c5b44fa0e28ce3c4ad2190
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 22:50:22 +00:00
Tor Arne Vestbø
68f20bb8f4 macOS: Make screen property changes more verbose and granular
We only update the properties that have actually changed.

Change-Id: If711530c6118d2550d5a0e968ee02c903b44fd04
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 20:49:05 +00:00
Friedemann Kleint
144d33df72 Windows: Refactor the debug operator for the MSG message struct
- Fix spelling
- Use noquote
- Make helpers static
- Remove C-style casts
- Remove Borland-specific code
- Streamline code
- Use QString::fromWCharArray()
- Remove #ifdefery and undefined macros
- Fix replicated base "wParam(0x0x0)" caused by formatting "(0x%p)" (MSVC)
- Replace the flag/enum lookups with variadic arguments by extending the
  lookup struct used for messages and helper functions

Change-Id: I04d861775f3c306e6d449c5a9b423eb244e99a36
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-08-03 20:35:46 +00:00
Friedemann Kleint
b12735f178 Windows: Fix QEventLoop::ExcludeUserInputEvents for pointer events
Factor out the check for user input events from
QEventDispatcherWin32::processEvents() to a small
helper and add pointer messages (by value as to avoid MinGW issues).

Task-number: QTBUG-60437
Task-number: QTBUG-69687
Change-Id: I38bf227f862fcc44177a5027cafe1df49a10a919
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-03 20:35:44 +00:00
Friedemann Kleint
abc024eef7 uic: Fix clang-tidy warnings
- Simplify/streamline if statmenents
- Change else if to if after return/break/continue
- Use isEmpty() for containers instead of checking size()
- Replace index-based loops by range-based for

Change-Id: I008228a99082a4d0e27be9f6c6af392602140b2f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-08-03 20:35:41 +00:00
Simon Hausmann
22eb4bacae Enable QPluginLoader test for static builds
The majority of tests use QPluginLoader::setFileName implicitly, which
refuses to do any work in static builds. Therefore the majority of tests
are skipped. But in the future we'll get tests here that for example use
QPluginLoader::staticPlugins() and for that we want to include the
sub-directory in the build and test run.

Change-Id: Ib8ec274e22ac8050feaca8967eb8626b53876b92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-03 20:26:58 +00:00
Thiago Macieira
dc8d4fe30f QUrl: Add qustrchr() and use it to speed up the fast URL full decoding
The character search in the findChar() static function in qstring.cpp is
more efficient than what we had in qurlrecode.cpp and there's no point
in duplicating it. It also has a Neon implementation. So make the
implementation available for use in QtPrivate::qustrchr().

This also simplifies the implementation.

Change-Id: Ib48364abee9f464c96c6fffd152eedd0cd8ad7f8
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-03 20:26:56 +00:00
Thiago Macieira
98dda3f5ac Move the createUnixEventDispatcher() function to a namespace
Easier than renaming it with a "qt_" prefix everywhere it's used
(it's in a lot of plugins).

Change-Id: Ie01831ddac5446fdbdeefffd15468918f3bc2238
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-03 20:26:53 +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
Thiago Macieira
95c0b24cd8 Add "qt_" prefix to asciiToDouble and doubleToAscii functions
Change-Id: Ie01831ddac5446fdbdeefffd154688839acbe838
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-03 20:26:48 +00:00
Thiago Macieira
6c8160b0dc QCborValue diagnostics: Properly escape strings
I'm intentionally not testing improperly-paired surrogates, since those
can't be encoded in CBOR.

Change-Id: I0d3cc366baaa49f3ad28fffd154240287ce34c22
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-03 20:26:42 +00:00
Ryan Chu
0eb1574b28 Disable Docker-based test servers on QEMU devices temporarily
Before libnss-mdns package is added to boot2qt dependency, the QEMU
devices should keep using the remote test server. There are two Linux
QEMU devices using 'linux-generic-g++' and 'linux-lmx7-g++' target
mkspec.

Relates to yocto/meta-boot2qt (Change-Id: I480f45)

Change-Id: I7870d3a184109e0abf712b4513148cf9a4520189
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-03 19:25:29 +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
Frederik Gladhorn
b9b53adb69 Minor grammar fixup
Change-Id: I528a2b2d8e9734bf5c00948a78369f4e89af16fc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-03 18:11:24 +00:00
Frederik Gladhorn
4d9fb42bb9 Fix EDID vendor table generation script: source git repo is gone
fedorahosted seems to be gone and I didn't find a better source for the
data.

Change-Id: Ifb02b9833a735bab4aff2dc7a6db46aedd567583
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-03 18:11:17 +00:00
Frederik Gladhorn
faa67443fe Keep EDID pnp IDs sorted
In Python 3.6 the sorting comes for free, since dict keeps the insertion
order, but adding sorted means older Python versions behave the same.

Change-Id: I3ac4c0f5c3739cb8b284c8a02c4a96b5f41b2286
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-08-03 18:11:11 +00:00
Frederik Gladhorn
e201878b93 Fix manufacturer parsing from EDID
The code was quite dubious, in the edid data, the manufacturer is
encoded with a three letter shortcut. In addition it can be set by the
extra data strings, which is not often the case. We would randomly
overwrite the identifier string, so clearly separate the pnpId (3 letter
ID) out and use the fallback table we have.
Also looking up the manufacturer string twice is pointless (contains and
then operator[]).

Change-Id: I18882a78d69b9f3dfc2af31e646ded44f2b70a50
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-03 18:11:01 +00:00
Frederik Gladhorn
5273604dac Fix EDID parsing: strings can be 13 bytes
The spec gives 13 bytes (5 header, 13 data in increments of 18).

Change-Id: I059590cd750ac403a1f3b44b5f9a0ee300cff5b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-08-03 18:10:54 +00:00
Giuseppe D'Angelo
1a4a2f7f58 QLogging: make QRegularExpression objects static const
To avoid recompiling them multiple times.

Change-Id: Ie4766be3bbaa536bf22b0eaacc430055fe4651cd
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-08-03 18:02:14 +00:00
Tor Arne Vestbø
4b7cb3bc91 Don't trigger composeAndFlush for native child widgets unless needed
The textureChildSeen flag is set on each widget the first time it has
a child needing textures, which triggers the composeAndFlush codepath.

If a top level widget had a child needing this codepath, but other
native children not needing it, we ended up always using composeAndFlush
for the native children, since we were checking textureChildSeen of the
top level widget.

We should check the child widget instead, which will never have the flag
set unless itself had children that required composeAndFlush. This matches
the logic in findAllTextureWidgetsRecursively, which also checks the
child widget and not the top level widget.

Done-width: Laszlo Agocs <laszlo.agocs@qt.io>
Change-Id: I65064eef41e56d9c1a789a96cedb98b11e8a177a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-03 17:48:02 +00:00
Tor Arne Vestbø
ffae448dc3 macOS: Reorganize QCocoaGLContext
Group methods by their areas of responsibility to make it easier to
follow the logic of the code.

Change-Id: I64dbf60004d0f4c281312451e0781da31997c64d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-08-03 17:17:50 +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
Oswald Buddenhagen
133fb029a6 make it possible to override the basename of module config files
using qt$$MODULE isn't enough if the module is composed of submodules
which need the final module's headers, because that would require two
modules having the same module .pri file.

the first thought to fix this was to just use $$lower($$TARGET), but
that breaks for testlib (QtTest). while the config file name isn't
public api, it's included by a public header, so changing it is risky.

so instead stay with the original pattern, but make it explicitly
overrideable.

the cherry-pick is needed to support QtWebEngine 5.12 with Qt 5.11,
a requirement that was raised too late.

Change-Id: I758c46ed403620620d577ae16866ce751271b63e
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 95b0e4c956)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-03 14:15:41 +00:00
Paul Wicking
c6cca0f492 Doc: Update out-of-date image in QColorDialog documentation
Task-number: QTBUG-58420
Change-Id: Ib5c7a3f681b082182cf6ec9aa62028b7040e81bf
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-03 12:53:57 +00:00
Paul Wicking
6953e513f9 Doc: Clean up Qt::ApplicationAttribute docs
* Remove () from links to QGuiApplication link names. The link targets
  QGuiApplication, and the syntax Q(Gui)Application to suggest both
  QGuiApplication and QApplication seems unnecessary, as QApplication
  derives from QGuiApplication anyway.

* Move added in version line to the bottom of each entry that contains
  said line for consistency.

* "was added in" > "has been added in"

Task-number: QTBUG-56077
Change-Id: Ife93acb7936ff9f0d3af2f2f456ad0db95419797
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-08-03 12:32:55 +00:00
Paul Wicking
8770461115 Doc: Update really old screenshot in Sliders Example
Task-number: QTBUG-63248
Change-Id: Id756d86539987562b9455881364928ccf7349fbf
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-03 12:32:32 +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
Paul Wicking
d2d59e77d5 Doc: Increase precision in description of convenience typedefs
Task-number: QTBUG-53856
Change-Id: I57917bb311d1d93e0903f2b3e021cc4db0f0d05e
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-08-03 10:28:02 +00:00