Commit Graph

36447 Commits

Author SHA1 Message Date
Timur Pocheptsov
73b9242d7e tst_QSslSocket::qtbug18498_peek() - fix several problems
It all started from the compiler's warnings about 'this' captured but
not used in lambdas. While fixing this it was noticed that 'client' socket
has a lifetime longer than the test case itself (the socket has a parent,
which is tst_QSslSocket object). The 'server' socket was simply leaked.
So there is no guarantee that some of them (or both) later, after the
test failed in one of QVERIFY, for example, does not emit 'encrypted'
upon receiving more data; this will result: in reading/writing from/to
invalid memory location (captured local 'encryptedCount') and/or probably
exiting event loop when it's not expected to do so.

Change-Id: I51de0493d989a5ba36de2cef58d35526c0e26cda
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-06-28 03:28:38 +00:00
Andre de la Rocha
92666ff521 Fix minor stuff in Windows UI Automation support
Adding missing "override" keywords in overridden interfaces, using
"#if QT_CONFIG(accessibility)" instead of "#ifndef QT_NO_ACCESSIBILITY",
and other minor bits. No change in behavior expected.

Change-Id: Ief0e23cb7b577dd3e4af21750b6beccc80d6a2f8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-06-27 23:31:26 +00:00
Giuseppe D'Angelo
aaf60da01c QRegularExpression: fix compiler warning in test
QTest::addRow expects a format specifier; this usage makes GCC complain
with -Wformat-security. Use the "old" newRow call instead.

Change-Id: Ieed8e4f64ff5e3d0d4e87325629d20ed6839ff9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-27 17:52:45 +00:00
Timur Pocheptsov
b78342f553 QAbstractSocket - protect against the broken invariant
It's possible to use QAbstractSocket (more precisely QUdpSocket) in
a quite unusual way: connect to its stateChanged() signal and call
close() in the slot (thus invalidating socketEngine pointer). For
QAbstractSocket::bind() this results in a null-pointer
dereference.

Task-number: QTBUG-69063
Change-Id: Ife2c778ff59ccc7b99a96caa5ba67f877aaefe42
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-06-27 17:40:25 +00:00
Oswald Buddenhagen
d550ba4e96 qmake: make access to raw data temporaries safe
make sure the access is properly scoped and does not recurse.

Change-Id: Iaa345cd2771811281b9ed6f634c70235a78c3c33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-27 17:24:09 +00:00
Oswald Buddenhagen
d68016c739 qmake: centralize resolution of file name arguments to qmake functions
Change-Id: Id867e4653b0ec506332174ae67c9ee21e722c1e3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-27 17:24:03 +00:00
Oswald Buddenhagen
811d8b82b5 qmake: make argument validation of built-ins data driven
at the time this patch was conceived, it was meant as an exercise in
getting rid of usages of ProString::toQString(m_tmp). however, this was
meanwhile superseded by use of toQStringView().
but the change itself should have been done a long time ago already, and
there is no harm in going through with it.

on the way, this also unifies and fixes some of the error messages.

Change-Id: I337aff994c508df783df4794c3fa0762d83a691b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-27 17:23:57 +00:00
Thiago Macieira
10e5ec2557 QByteArray: implement qstricmp with SSE 4.1
Using SSE 4.1 because of the need for PMINUB.

Change-Id: Ib48364abee9f464c96c6fffd152ebd3f8ea7fe94
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-27 16:29:14 +00:00
Simon Hausmann
cd64a96b31 Fix QString::localeAwareCompare with composed/decomposed strings on Windows
With ICU and on macOS it appears that the comparison is done on a
canonical form, while CompareString(Ex) does not do that, as the added
test verifies. Explicit normalization fixes that.

As a bonus, this also unifies the code path between regular Windows
and UWP by unconditionally using CompareStringEx (which requires
Vista or later).

This issue surfaced while running the ECMASCript 6 Conformance Test
Suite in QtQml.

This re-uses the existing test for localeAwareCompare, which was
disabled on Windows, macOS and Linux with ICU (the common case).

Change-Id: I52440fce60b54745ead1eff005ec51e98e2a79ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-06-27 16:21:22 +00:00
Oliver Wolff
00d9ade6e6 tst_qlogging: Fix execution for WinRT
Not putting executables into debug/release subdirectories leads to the
WinRT AppxManifest being overwritten by the wrong configuration. When Qt
is configured with -release for example, it was possible that the debug
manifest (Manifest files are always created next to the target) is
written last and thus contains debug VCLibs as a dependency.

Additionally the test was changed in that way, that the resulting file
system structure (having helper and test application in a "top level"
debug and release folder) is the same structure as in tst_qobject.

Change-Id: I034752b4e5d22b98f6def95fb53c2b1947dded03
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-27 16:06:01 +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
Oliver Wolff
4d7137c4a0 tst_qobject: Fix execution in debug&release shadow builds
The previous approach of having the signalbug helper in a subdirectory did
not work for shadow builds, as QFINDTESTDATA would not find that dir. By
putting both test and helper into the same directory, the helper will be
found in the test's current working directory.

The second problem was that not putting executables into debug/release
subdirectories might have lead to the WinRT AppxManifest being overwritten
by the wrong configuration. When Qt is configured with -release for
example, it was possible that the debug manifest (Manifest files are
always created next to the target) is written last and thus contains
debug VCLibs as a dependency.

Change-Id: Ia39315432860405642542449296c16dd2ae9fa9f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-26 10:56:31 +00:00
Oliver Wolff
680038e2c1 winrt: tst_qdoublespinbox: Remove QEXPECT_FAIL for editingFinished
Behavior has been fixed.

Task-number: QTBUG-68297
Change-Id: I217fffc3c9a189d48e673356b1123f9eda8af94a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-26 10:56:28 +00:00
Gatis Paeglis
4050ee6ac7 xcb: rely on WM_SIZE_HINTS gravity to handle x,y positioning
The original code was added by b316c3ac5e
(in 2012). This patch changes two things:

1) We now rely on WM to position a window based on the set gravity. It
should not be necessary to calculate coordinates manually as was done
in windowToWmGeometry(). We don't even know the decoration size before
the window is mapped.

2) We now update gravity whenever needed instead of hardcoding based
on what Qt APIs (setGeometry vs setFramePosition) where used to set
the initial window position.

The patch from b316c3a says:

"Determine gravity from initial position. Do not change later as
it will cause the window to move uncontrollably"

Since it did not elaborate on the situation, we can only assume
that it was caused by another bug in Qt at the time or perhaps
a broken WM. From [1]:

"Applications are free to change their win_gravity setting at any
time. If an Application changes its win_gravity then the Window Manager
should adjust the reference point, so that the client window will
not move as the result."

Tested on Ubuntu/Unity, KDE/KWin, Gnome-shell/Mutter, Lubuntu/OpenBox.
Works as expected everywhere expect Unity. Unity seems to ignore
XCB_GRAVITY_STATIC and treats it as XCB_GRAVITY_NORTH_WEST, which means
that setGeometry/setFramePosition produce the same placement on this WM
(the behavior was the same also before this patch).

P.S. Also renamed xRect -> rect, which was a leftover from
ae5f2a6672

With this change we can un-blacklist QWidget save/restore geometry
auto tests.

[1] https://specifications.freedesktop.org/wm-spec/latest/ar01s09.html

Task-number: QTBUG-66708
Change-Id: I381eef5d34dddb04de16a897ce5540b9c430b216
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-06-26 07:11:34 +00:00
Christian Ehrlicher
0e2dae902b QTreeView: speedup expanding items via keyPressEvent/asterisk
Expanding items with asterisk is done with expand(QModelIndex) which in
the end calls layout() which is very slow and useless until all items
are expanded. Therefore delay the relayouting until all items are
expanded.

[ChangeLog][QtWidgets][QTreeView] Speedup expanding items when
pressing asterisk

Task-number: QTBUG-39486
Change-Id: Ieb798fc22e9fa0dcac4bb92de7e3ed3ebb9d1c38
Reviewed-by: David Faure <david.faure@kdab.com>
2018-06-25 18:58:10 +00:00
Christian Ehrlicher
5712c62d1c QCommonStyle: properly elide last visible line
Rewrite QCommonStylePrivate::viewItemDrawText() to be able to elide
lines which are too long and the last visible line. The painting is now
done in one pass instead of two and lines which are not visible due to
a size constraint are not painted at all.

[ChangeLog][QtWidgets][Itemviews] Fixed eliding of multi-line items

Task-number: QTBUG-12129
Task-number: QTBUG-14949
Task-number: QTBUG-57891
Change-Id: I3a41938e442663ecd7e5ca56bf6bbd857edafb7d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-25 18:58:07 +00:00
Thiago Macieira
2cf5c5a602 SIMD: Remove unused (and unlikely to be ever used) AVX-512 profiles
"AVX512MIC" (Many Integrated Cores) is the set of AVX-512 features found
on the Intel Xeon Phi coprocessors (codename "Knights Landing"), which
is an unlikely architecture for Qt to run on.

The two profiles with VL came from study of early GCC code and are no
longer applicable. GCC source code now shows both VBMI and IFMA as part
of the -march=cannonlake feature set.

Change-Id: Iff4151c519c144d580c4fffd153a0f268919fe2c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-25 18:49:33 +00:00
Thiago Macieira
f6d9cc5b79 SIMD: Refactor the constants to be actual bit values
... instead of being the bit numbers. This allows us to test more than
one feature at a time with qCpuHasFeature (see commit about the Haswell
architecture features). The drawback is that we won't be able to handle
more than 63 different CPU features, though we're likely quite far from
it (x86 currently has only 36 features).

Change-Id: Iff4151c519c144d580c4fffd153a0acbfd74c2c6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-25 18:49:28 +00:00
Thiago Macieira
74ce4ffff6 SIMD: Move the #include for qsimd_x86_p.h a bit lower in qsimd_p.h
It needs to be after our extra #defines for CPU features, otherwise the
qCompilerCpuFeatures variable won't be set correctly.

Change-Id: Iff4151c519c144d580c4fffd153a0a93ca01bbe6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-25 18:49:18 +00:00
Thiago Macieira
f05d1b0856 QMetaType: remove compatibility code for MSVC 2013
We use the constexpr code for MSVC 2015.

Change-Id: I91f63171877743978cb3fffd153ad52a3ee293d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-06-25 18:49:07 +00:00
Gatis Paeglis
36818779b9 tests: un-blacklist tst_QSizeGrip::hideAndShowOnWindowStateChange on xcb
According to local testing and Grafana statistics for the period of the
last 1 year, this test has not been failing on XCB.

Change-Id: I86640b22c9e7a258965805a661e1e8c3ead8d012
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2018-06-25 13:41:50 +00:00
Gatis Paeglis
732be3e236 tests: un-blacklist tst_QGestureRecognizer::panGesture on xcb
According to local testing and Grafana statistics for the period of the
last 1 year, this test has not been failing on XCB.

Change-Id: Ia7fda4c42d4aeaecd4485d18383cf46bf6af63d1
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2018-06-25 13:41:40 +00:00
Gatis Paeglis
2f2bfc4e59 widgets: fix QWidget::save/restoreGeometry()
QWidget::restoreGeometry() is calling QWidget::move() with restoredFrameGeometry,
which internally calls setGeometry() and sets positionPolicy = QWindowPrivate::WindowFrameExclusive,
which is invalid: restoredFrameGeometry is WindowFrameInclusive geometry.
QPA plugins rely on correctly set policies when interpreting x,y. QWidget::move()
was not designed for this AFAICT, so making it to accept frame geometry is
no-op. It is widely used legacy code, changing it could cause regressions.

Save/restore API was introduced in Qt 4.2, at that time we did not have APIs
like QWindow::setFramePosition(), so its unclear why geometry() was not stored
instead. The documentation also is somewhat unclear:

"[..] save the geometry when the window closes [..]"

Frame or client geometry? It does not specify. And from the code we see
that frame geometry was passed as client geometry, not making the original
intention clearer. Besides that, restoreGeometry() is full of other undocumented
assumptions where to place windows and when to fail (fortunately its easy
to write your own save/restore logic). Added a Qt 6 note in the source code.

What this patch changes:

Now we store geometry() in saveGeometry() and use that value in restoreGeometry()
by setGeometry(). This does not cause any behavior difference in window
positioning (tst_QWidget::saveRestoreGeometry still works). Geometry restored
from data saved with earlier versions of saveGeometry() might be positioned at:
x + leftMargin, y + topMargin.

This patch makes tst_QWidget::saveRestoreGeometry to always fail instead
of being flaky. Blacklisting for XCB instead of selected distros.

Also enabled excluded code paths for XCB on tst_QDockWidget::restoreDockWidget().
It does not seem to be flaky, maybe it was in 2015, but lot of things have changed
since then.

Task-number: QTBUG-66708
Change-Id: Ic86a6fd091e2c71b7550b2f476386da704253cd4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-25 13:41:06 +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
Tor Arne Vestbø
92b3ef24ed Fix window(child)geometry manual tests
Task-number: QTBUG-67632
Change-Id: I16482d3501cc7c7893d6eac4617c77dc70e1e215
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-06-25 13:01:14 +00:00
Gatis Paeglis
f8944a7f07 widgetwindow: send DragMove for every DragEnter
... as specified in the documentation. This was a regression from Qt4
and can cause mouse cursor flickering durig dragging on e.g. custom
widget where some areas of the widget do not accept drag-and-drop.

Task-number: QTBUG-67155
Change-Id: Iaa6f9407181931ed8e3d6a8fec13fd59d3c8625d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-06-25 12:45:54 +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
Alexander Afanasyev
18d0a30727 Restore creation of '.pc' files
This is a partial revert of commit:6c5d227da1709eb81968823f38a133747c0e95b0

All credits to Martin Afanasjew <martin@afanasjew.de> for the original patch.

Change-Id: Ib66303505888c821fc43eca213b956ce76acbbfa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-25 10:24:40 +00:00
Morten Johan Sørvig
0e844eff19 Fix framework include paths in .pc files
The macOS framework build of Qt copies headers to each
framework instead of a centralized include location.
Update the .pc file generator to match this behavior.

Add two include paths to the .pc files:

  -Ipath/to/lib/foo.framework/Headers
  This makes #include <FooHeader> work.

  -Fpath/to/lib
  This makes #include <Foo/FooHeader> work.

Task-number: QTBUG-35256
Change-Id: I013ce161c904fe6b7bbb03e33c163d32fdda0647
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-25 10:24:37 +00:00
Morten Johan Sørvig
3b4211ec47 qmake: remove system framework path check from writePkgConfigFile()
/System/Library/Frameworks is now under system integrity protection
and is not usable for 3rd-party framework installs.

/Library/Frameworks continues to be a documented framework install
locaton.

Change-Id: I26f96ed57985218452ebbf9578e08f04b4e5cfd8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-25 10:24:35 +00:00
Thiago Macieira
b03a11301b Update the ICC x86 sub-architecture compiler options
By using -march= instead of -x, we turn on some other processor features
too. This was already the case for AVX2, which enabled all Haswell
features (notably FMA, BMI and BMI2).

Change-Id: If025d476890745368955fffd153126fc9eafc5d6
Reviewed-by: Alexander Shevchenko <sav_ix@ukr.net>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-23 20:16:35 +00:00
Giuseppe D'Angelo
42b9b7b5d0 QRegularExpression: minor code tidies
Use nullptr, clarify comments.

Change-Id: Ib5f5879d8281cc455635513f82ff8c4bdb951ea8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-23 09:37:46 +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
Christian Ehrlicher
c699daeceb QListView: do not delete item on internal move
When an internal DnD occoures in IconMode, the item is moved to it's new
place but the logic in filterStartDrag() has no clue about the fact that
an internal move happend. Therefore the item gets deleted. Fix it by
changing the event's drop action to Qt::CopyAction to avoid the deletion
as it is done within QListWidget DnD code.

[ChangeLog][QtWidgets][QListView] Do not delete item on internal move.

Task-number: QTBUG-67440
Change-Id: I873d3c9fa76e107e108d9af0dcf8cecd1e18a18f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-06-22 20:05:11 +00:00
Gatis Paeglis
1acdcdaa4d xcb: add static overload for setting window name
Change-Id: Ib581a582059e196567514f40b1964696ceaf3a88
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-06-22 19:50:42 +00:00
Giuseppe D'Angelo
06af9a1e38 QRegularExpression: refactor pattern optimization
After the move to PCRE2, optimizing patterns has been a thorn in the
side due to the fact that PCRE2's JIT compiler modifies the pattern
object itself (instead of returning a new set of data, like PCRE1
did). To make this fit with the existing behavior, a read/write
lock was introduced, with the read part locking when matching and
the write when compiling (or JIT-compiling) the pattern.

This locking strategy however introduced a performance issue,
as we needed:

* to acquire a write lock to compile/optimize the pattern (incl. the
common case where the pattern was already compiled, so bailing out
immediately);

* to acquire a read lock during the actual match, to prevent
some other thread from optimizing the pattern under our nose.

This was due to the "lazy" optimization policy of QRegularExpression
-- optimize a pattern after a certain number of usages. The
excessive amount of locking effectively limited scalability.

Simplify the code, and drop that policy altogether: since JIT
compiling in PCRE2 is faster and pretty much "always recommended",
just always do it for any pattern (unless it gets disabled via
env variables) when compiling it.

This allows to go back to a plain QMutex, and now the actual
matching doesn't require acquiring any locks any longer. Of course,
there is still a mutex acquired just before matching for checking
whether the pattern needs recompiling in the first place; this can
probably be further optimized via double-checked locking (using
atomics), but not doing it right now.

This shift makes a couple of pattern options controlling
optimization useless, and allows to centralize the 3
QRegularExpression tests (which were actually the very same test,
just setting slightly different optimizations strategies).

While at it, install a stress-test for threading, with the idea
of running it under TSAN or helgrind to catch bugs in
QRegularExpression's locking.

[ChangeLog][Important Behavior Changes][QRegularExpression] Regular
expressions are now automatically optimized (including JIT
compiling) on their first usage. The pattern options
OptimizeOnFirstUsageOption and DontAutomaticallyOptimizeOption no
longer have any effect, and will get removed in a future version of
Qt. QRegularExpression::optimize() can be still used to compile and
optimize the regular expression in advance (before any match), if
needed.

Task-number: QTBUG-66781
Change-Id: Ia0e97208ae78255fe811b78029ed01c204e47bd2
Reviewed-by: David Faure <david.faure@kdab.com>
2018-06-22 19:43:54 +00:00
Alexander Shevchenko
305f57411d centralize ICC flags for *nix-systems toolchains
linux-icc and macx-icc toolchains contain a significant amount of code
which can be merged to a common configuration file.

as a side effect, such merge resulted in reduction a parts of
linux-icc and macx-icc toolchains to the common view.

Change-Id: I37d110734eeeb9bd61ca0aa942de380ac8e75f1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-22 17:04:06 +00:00
Joerg Bornemann
6173e1d6f8 Build the Windows platform plugin with QT_NO_FOREACH
...for consistency with the other platform plugins.

Change-Id: I85946d610a62c19140618c83f80c4aa63fce4bc3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-06-22 13:10:54 +00:00
Timur Pocheptsov
033a1a2793 Add a secure UDP client example
A simple application that establishes DTLS connection(s) and
sends/receives datagrams. Class DtlsAssociation is
essentially a QUdpSocket|QDtls pair: it initiates a handshake,
handles timeouts and errors. After establishing an encrypted
connection it sends messages to the server and processes responses.

Task-number: QTBUG-67596
Change-Id: I92d481b7dfd2459e6a93c754b338a2e897a7feaf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-22 13:09:42 +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
Ulf Hermann
99d4f0026f Make the stub implementation of QThread compile again
We cannot inline methods of QThreadPrivate because QThreadData has to
be declared before. The global QThreadData needs to be accessible to
QThreadData::clearCurrentThreadData(), and QAdoptedThread::run() has to
be moved inside the #ifndef QT_NO_THREAD block as run() doesn't exist
in the stub and Q_DECL_OVERRIDE would be wrong.

We also fix the QThreadData::current() method to take and use the same
parameters as in the non-stub case.

Change-Id: Id29ca44b11fa95ed2df7cc39243a07ce7d3c455e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-22 07:14:35 +00:00
Ulf Hermann
31023ef553 Make the sleep methods available in QThread even if QT_NO_THREAD
sleep, msleep, and usleep are not actually related to threading and
serve a purpose also in a single threaded application.

Change-Id: Iba2e343d48a9c09e60125bc1b589047e0241608a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-22 07:14:29 +00:00
Gatis Paeglis
47aebe3587 xcb: account for misbehaving Unity DnD Manager
... which may cause dnd data to be lost.

As soon as Unity sees that dnd operation has started (it monitors
for changes on XdndSelection) it creates an invisible window
named XdndCollectionWindowImp that fill entire screen and starts to
act as DnD target. Once it has fetched the mime data it moves
XdndCollectionWindowImp away without sending any DnD termination
events. XdndCollectionWindowImp does not respect the XDnD protocol.
Only when its gone we can start a normal dnd operation - looking for
real DnD target. We ask windows if they are XdndAware on the initial
mouse press and subsequent mouse move events. This patch sets a cursor
to Qt::ForbiddenCursor while DnD is interfered by XdndCollectionWindowImp.
A user will see the real DnD action (reflected by cursor) only after
the next mouse move when XdndCollectionWindowImp has stopped interfering.
We also setCanDrop(false) while DnD target is XdndCollectionWindowImp.
Temporary seeing ForbiddenCursor is better than losing DnD data.
Dropping in this state means that drop will simply be ignored.
It is unclear what Unity developers expected DnD source window to do when
user releases mouse while XdndCollectionWindowImp is stealing the data.
Looking at Unity code, it appears that they were hoping to be quick
enough that it would never happen.



Task-number: QTBUG-49464
Change-Id: I10880073f6d843572be44fe9a3c4f78194466299
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-06-22 06:09:36 +00:00
Gatis Paeglis
6a28a2cc34 xcb: qxcbdrag.cpp cleanups
- moved finding of XdndAware target logic in its own function to
  reduce size of QXcbDrag::move().

- switched to use categorized logging with more consistent logging messages

- added more comments to avoid constatly looking at the
  specification for the meanings of Xdnd* actions and who
  sends/receives the action.

- removed dead code (findXdndAwareParent), which should have been
  removed in 269fdbdd2b when reimplementing
  this logic in XCB.

- removed needless reseting of state variables in various places as
  this is handled in QXcbDrag::init() on DnD start.

- renamed variable in QXcbDrag::dndEnable(): xdnd_widget -> window

- and other minor cleanups

Change-Id: Ib667f80ceb4c07b7409a90c041044c98665877f3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-06-22 06:09:27 +00:00
Oliver Wolff
7bc667e5e0 Fix tst_qtextbrowser for configurations with builtin testdata
Change-Id: I1dc17642934e8fd2d5e3b7f245e1fb0c26b8e75a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-06-22 05:02:50 +00:00
Oliver Wolff
569f368ad0 winrt: Make widgets/widgets auto tests pass
Task-number: QTBUG-68297
Change-Id: I64d6e89e515a6284fbd8625cded22511de783481
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-22 05:02:49 +00:00
Oliver Wolff
ea4a038bb7 winrt: make widgets/kernel auto tests pass
Task-number: QTBUG-68297
Change-Id: I96839927fd98e2c6e533a2a3587ae66e599ec8fc
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-06-22 05:02:45 +00:00
Oliver Wolff
70884b4d2d winrt: Make itemview auto tests pass
Task-number: QTBUG-68297
Change-Id: I285dca678c34fd4170686635c7541e598442aa29
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-06-22 05:02:44 +00:00