Commit Graph

8086 Commits

Author SHA1 Message Date
Friedemann Kleint
1c3dc8cfb8 tst_QFile::largeUncFileSupport(): Use QTRY_VERIFY() to open the file
Open failures due to sharing violations have been observed in Coin.

Change-Id: If7fbe01a454b3c343c0b87f73db50c28eae901c3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-10-27 20:02:58 +00:00
Friedemann Kleint
cd45d0f712 tst_QFile: Introduce StdioFileGuard
Guard the FILE * obtained by fopen() by a RAI class ensuring
the file is closed on destruction.

Change-Id: I9297f91ca2120238f3a44bad92bca5f920e01aa8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-10-27 20:02:53 +00:00
Friedemann Kleint
ed31393e06 tests: Fix warnings about inconsistent override
tst_noqteventloop.cpp   'event' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'canFetchMore' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'fetchMore' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'hasChildren' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'rowCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'columnCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'index' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'parent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'data' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'begin' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'end' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'updateState' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'drawPixmap' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'type' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Change-Id: I2a0c5da15994619383c1f90fee311927e58d7af0
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2017-10-27 20:01:25 +00:00
Gatis Paeglis
754b636053 tests: use QSKIP for temporarily disabled tests
Change-Id: Ib088e943668d00cbbd0e6e04ab7d565477b0cc51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-27 11:37:26 +00:00
Gatis Paeglis
f239dbe60a tests: enforce Qt menubar in tst_QMenuBar::taskQTBUG56860_focus
... the same way other tests do in this file.

Change-Id: Ifcaee084bd20c55d6b9f7ddcf35daebce2a02e07
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-27 11:37:21 +00:00
Robert Szefner
d1422da264 Fix psql_schemas test
Ignore case when comparing table names in PostgreSQL

Task-number: QTBUG-63861
Change-Id: Iaf56dff11ee79f96fd3b136e1576f2578328ac79
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-26 13:00:06 +00:00
Thiago Macieira
9574436666 QUrl: make sure setPort(nonnegative) is taken as part of authority
There were a couple of corner cases where doing setPort() would result
in QUrl thinking that an authority was not present. Since the full URL
parsing implies that a host is always present if the authority is
present, then we also imply that setting the port number makes the host
be present too.

Change-Id: I69f37f9304f24709a823fffd14e67c12da18d69f
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-26 04:46:04 +00:00
Timur Pocheptsov
76a6b32942 HTTP/2 - make protocol settings configurable
1. Recently we have updated our receive window size to a larger value.
Unfortunately, this also results in auto-test pumping through
more data, which probably takes more time on CI.
At the moment we do not have any public API on QNAM's level to
customize HTTP/2 parameters (aka 5.10/FF and so on). So we use the fact
that QNAM is QObject and we can set a property on it. This property
is our Http2::ProtocolParameters object that allows us to configure:
- HPACK parameters (in 5.10 - noop)
- session receive window size
- different SETTINGS as described by RFC 7540, 6.5.2.

2. Undocumented environment variable to set ENABLE_PUSH is not needed
anymore.
3. In 5.11 Http2::ProtocolParameter will become a public API
and we'll introduce a new setter in QNAM.

Change-Id: If08fd5e09e7c0b61cf9700b426b60b5837b6b2e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-26 04:13:40 +00:00
Friedemann Kleint
d020d3f4ed Stabilize tst_qaccessibility
Ensure windows are cleaned up. Add scaling where native coordinates
are used.

Task-number: QTQAINFRA-1440
Change-Id: Ie080ff780c687418f4dc5d71fd49112486b217e6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-24 16:43:56 +00:00
Maciej Czarnecki
3b8f828174 QWizard: Do not remove the Next button's shortcut
Currently on Windows, the Next button's shortcut doesn't work, because
QWizard overrides it with an empty key sequence.
The key sequence should be changed only if isVistaThemeEnabled() returns
true.

Task-number: QTBUG-46894
Change-Id: I54f26388b167973cc8065a867d9e771c1e6a2a72
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-24 16:43:52 +00:00
Liang Qi
4f9b2cb026 Remove duplicate qnx from the platform file selector names
Update the QFileSelector tests for QNX.

Co-authored-by: James McDonnell <jmcdonnell@blackberry.com>
Change-Id: I68a8fde86725596323b539433287ac1a18fac1eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-24 16:43:39 +00:00
Mårten Nordheim
18f0a45964 Fix redirecting all the other methods for HTTP 307 and 308
c4cf90b1f7 made POST requests be
redirected properly, but this wasn't enough and should have included
every method/verb.

Change-Id: I37b12dc9fdffcbf2aadbd2360d4fc2584c024939
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-24 16:43:35 +00:00
Yulong Bai
7e7683cabb QAction: fix ::setData() always emits changed()
QAction::setData() always emits changed() even without actual data change.
Original code lacks a guard to check if the data changes.
According to http://doc.qt.io/qt-4.8/signalsandslots.html,
adding guard also benefits to prevent infinite looping in case
of cyclic connections.

Task-number: QTBUG-62006
Change-Id: I776369b668082f9f02e4502a36b1ae234ee7e079
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-10-24 16:43:30 +00:00
Gabriel de Dietrich
0261c22d41 Add menu creation manual test
We have found that there are three important operations
when it comes to menu creation and putting it up in the
native menubar:

    * Adding the action to its parent menu
    * Setting the submenu as the action's menu
    * Populating the actual submenu

This application tests all possible permutations for these
three operations, starting from the menubar and down two
more menu levels.

Two command-line options allow, first, to create a late
menubar that will replace the original menubar from the main
window form (--new-menubar) with, second, the option of
creating it parentless (--no-parent) before setting it as
the new main window menubar.

While mostly interesting for platforms supporting QPA menus
and menubars, this could be useful as a trivial check for
QMenu and QMenuBar in a pure QWidget environment.

As of today, the application shows at least three issues on
macOS which will be fixed in upcoming patches.

Change-Id: Id3c1e0f346c6fe27ab4656ff045b88a0a8623740
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-24 09:17:49 +00:00
Liang Qi
32f50225c4 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/direct2d/direct2d.pro
	src/plugins/platforms/ios/qiosclipboard.mm
	src/plugins/platforms/windows/windows.pro

Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
2017-10-23 09:40:54 +02:00
Sami Nurmenniemi
9c58dd1588 Blacklist and skip failing tests for Boot2Qt / 64 bit arm
Task-number: QTBUG-60263
Change-Id: I05978915b5bb7ae31069e8e9ae1dc273e483ddb0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-10-21 09:31:01 +00:00
Thiago Macieira
c90d9f95d2 QRandomGenerator: improve floating-point random generation
The previous version was good, just not optimal. Because the input was
an unsigned 64-bit number, compilers needed to generate extra code to
deal with HW instructions that only convert 64-bit signed input. And
that was useless because a double uniformly distributed from 0 to 1 can
only have 53 bits of randomness.

The previous implementation did exactly what the Microsoft libstdc++ and
libc++ implementations do. In my opinion, those implementations have an
imperfect distribution, which is corrected in this commit. In those, all
random input bigger than 0x20000000000000 has a different frequency
compared to input below that mark. For example, both 0x20000000000000
and 0x20000000000001 produce the same result (4.8828125e-4).

What's more, for the libc++ and MSVC implementations, input between
0xfffffffffffff001 and 0xffffffffffffffff results in 1.0 (probability 1
in 2⁵³), even though the Standard is very clear that the result should
be strictly less than 1. GCC 7's libstdc++ doesn't have this issue,
whereas the versions before would enter an infinite loop.

Change-Id: Ib17dde1a1dbb49a7bba8fffd14eced3c375dd2ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-20 18:10:33 +00:00
Mårten Nordheim
fc98878658 Fix cookie path matching for empty url path
The path wouldn't match if the cookie's path was root ('/') and the
URLs path was empty.

Change-Id: I6dcd10f1fdf4f48f14e50f1b169cbdfda7005849
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-19 12:51:38 +00:00
Orgad Shaneh
0354ba816f Clean dynamic function resolving done for XP in QFileInfo tests
Change-Id: I15364b1e8c4f4406fef2be68ca221a8867d0dcfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-19 10:59:04 +00:00
Orgad Shaneh
d57a7c4171 MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 API
Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-19 10:58:59 +00:00
Thorbjørn Lund Martsum
a1c985c10b QAbstractItemView: Make it easier to drop above and below items
Before this patch a very accurate drop position below
or above an index was needed. Therefore it was not that
easy to do.

This patch increases the above/below area to be about
18% of the item (still leaving the most space for the item).

An average user will likely be 2-3x faster with dropping
below or above (while not losing much when dropping on items).

[ChangeLog][QtWidgets][ItemViews] Made it easier to
drop above and below items.

Change-Id: I47f0f80c76878c17ebf3f93d0a0cc82755971c2a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-10-18 10:45:21 +00:00
Thiago Macieira
3fe74b76fd QHostInfo: Make getaddrinfo() mandatory
All systems must implement it by now. If there's any system still
without it, that means it has no IPv6 support, so they can disable
QtNetwork entirely.

[ChangeLog][Deprecation Notice] Starting with Qt 5.10, IPv6 support is
mandatory for all platforms. Systems without proper IPv6 support, such
as the getaddrinfo() function or the proper socket address structures,
will not be able to build QtNetwork anymore.

Change-Id: I3868166e5efc45538544fffd14d8c28046f9191b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-18 09:26:43 +00:00
Friedemann Kleint
3760bc7590 QTabletEvent/manual widgets test: Fix reporting of proximity events
Proximit events are sent to the QGuiApplication, catch them via
event filter.

Change-Id: I7f896e7d9f5c90347b9e3c708feb69abd1c5fc95
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-18 06:20:49 +00:00
Friedemann Kleint
dc03ac15b0 QTabletEvent/manual widgets test: Port to C++ 11
Change-Id: If5ebb45ce286d6a96c9f8bfe1fac70661d065460
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-18 06:20:45 +00:00
Mårten Nordheim
c4cf90b1f7 Fix redirecting POST for HTTP 307 and 308
All POST requests that were redirected would previously turn into GET
requests. This does not follow the standard for HTTP codes 307 and 308.

Task-number: QTBUG-63142
Change-Id: Ibd25a9566066e589670a9bc34e5dc5111f8139d5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 18:50:14 +00:00
Liang Qi
7e4571b7e7 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-17 18:29:37 +00:00
Mårten Nordheim
8a39384e90 Open a session during redirects when needed
In some cases when a session isn't needed (i.e. for localhost), the
session is not opened at all. If a program (e.g. our tests) redirects
from localhost to a different system (e.g. the qt network test
servers, or the internet) it will wait for a session forever. So, we
need to check if a session is needed for the redirect-target and then
open one. It is usually opened in
QNetworkReplyHttpImplPrivate::_q_startOperation

Change-Id: Id3b78182a3fb3f63f0235ecb1fb665df8bd0c4ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-17 14:22:22 +00:00
Gatis Paeglis
377d2502e3 tests: make exposeEventOnShrink_QTBUG54040 not flakey on xcb
From: https://tronche.com/gui/x/xlib/events/exposure/expose.html

"The circumstances in which the X server generates Expose events
are not as definite as those for other events."

On windows with XCB_GRAVITY_NORTH_WEST flag set we should not get
expose events according to e2665600c0,
but as stated earlier this might not always be true.

Nevertheless, sometimes we get expose event from X server when shrinking
window, but most of the time we don't. Make the test not flakey by
checking that we get at least 1 expose event, instead of exactly 1.
Now running test 500 times in a loop does not fail.

Task-number: QTBUG-63424
Change-Id: I8004e622020cc09e11b7d592faf6d9ee1b9cfee2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 542e11ab2b)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-10-17 13:58:36 +00:00
Gatis Paeglis
0aba5546ef tests: fix and un-blacklist tst_qgraphicsview::hoverLeave
Tests should not use QCursor to emulate mouse move, see QCursor::setPos() docs.

The flakiness of the test on XCB is not surprising when the test queries geometry
even before the window has been shown. With the re-factored version I could not
reproduce flakiness anymore.

Removed Q_OS_MAC and closed QTBUG-26274 as test passes on macOS from which I
assume that the underlying issue has been fixed.

Removed Q_OS_QNX ifdef as test does not rely on QCursor anymore.

This patch also fixes the issues on minimal / offscreen platform plugins.
QCursor::setPos() is evil for auto test purposes.

Note:

We intentionally use QTest::mouseMove(QWindow *window, ..), not the QWidget overload.
The QWindow version gets routed through QWSI, which ensures that all necessary events
are generated as expect. In QWidget code path this is currently disabled by
QTEST_QPA_MOUSE_HANDLING.

Change-Id: I285c26cff09e3f2750f8c2abbb1f46c8f7be984a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1af927976a)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-10-17 13:58:29 +00:00
Timur Pocheptsov
db333d6dba QNAM (redirects) - clear 'raw' headers before sending the next request
We already cleared 'cookedHeaders', which is a QHash for 'known headers'
(enumerators as keys instead of strings), now do the same for 'rawHeaders'-
not to end up with some weird mix of headers from all possible redirect
responses and the final response.

Task-number: QTBUG-61300
Change-Id: Ifd6655c4167840bb00d29446d36ce65ba2d5491a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 13:58:16 +00:00
Mårten Nordheim
b16add0dc6 QNetworkReply: Reduce noise and a fail when building with no-ssl
A few tests would QSKIP depending on the inclusion of SSL, producing
multiple lines of noise in the output.

And one test used https in one of its configurations without checking to
see if it could, causing an UnknownProtocolError.

Change-Id: I5f54bf1005f962cc027c099b816fbe245dc43d3f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 13:05:56 +00:00
Gabriel de Dietrich
198225983d QShortcut: Fall back to cross platform code in absence of QPA menu
On macOS, absence of a QPA menu means that we should be using our
own internal logic since there's no entity on the QCocoaMenuDelegate
to take care of the shortcuts.

Change-Id: I35ed8f0b55445f61d0528709d4debb636a502002
Task-number: QTBUG-61039
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-17 02:34:35 +00:00
Liang Qi
01afc8c810 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
2017-10-16 22:21:52 +03:00
Timur Pocheptsov
a520c179b8 HTTP/2 protocol handler: tweak receive window sizes
We were using the default ones, provided by RFC7540. It appears they are way
too restrictive and conservative: when downloading something relatively big,
a stream keeps spending the whole session/its own 'recv' windows and thus
we have to constantly send WINDOW_UPDATE frames. This significantly slows
down our HTTP/2 implementation, making it orders of magnitude slower than
HTTP/1.1. To fix this:

- We send SETTINGS_INITIAL_WINDOW_SIZE in the first SETTINGS frame
  to inform our peer that per-stream WINDOW is bigger than 64Kb
- We increase the session's receive window size.

Task-number: QTBUG-63722
Change-Id: I31312fcfd5f0fc0aee6aaa5d3562cc7d1b931adc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-16 16:54:32 +00:00
Thiago Macieira
65eed6d597 configure: make C++11 <random> a required functionality
Error out if it's missing or broken (Mersenne Twister not present).

This ensures that we never have a low-quality random generator in Qt.

Change-Id: I0a103569c81b4711a649fffd14ec80649df7087e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-10-16 16:25:34 +00:00
Joerg Bornemann
b5f2bf1a71 Fix QWinEventNotifier for auto-reset events
Auto-reset events are automatically reset to non-signaled when we get
notified about the signaled state. This implies that we cannot check the
event state again in activateEventNotifiers. Instead, store the signaled
state in a QAtomicInt and test and decrement that.

This amends commit 85403d0a.

Task-number: QTBUG-63555
Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-15 16:14:04 +00:00
Kai Koehne
f6cca6ab8a Replace 'an unique' with 'a unique'
Unique begins with a "y" sound, hence a unique is correct.

Change-Id: I9eb6b4d4c9ddab45af931e97c041c24edf163eca
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-11 18:44:57 +00:00
Timur Pocheptsov
5e71f40a34 A minor cleanup - fix a comment
... so that it comments the actual code, not what this code was before.

Change-Id: Ib191b9d7bd3ae3cda39a15f0f711cb1dd3c5c2b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-11 15:50:26 +00:00
Tony Sarajärvi
e03b64c5b1 Extend blacklisting of tst_qwidget tests to cover RHEL 7.3 & 7.4
The autotest has been blacklisted for RHEL 7.1 and RHEL 7.2 earlier already
and it is still failing in 7.4.

Task-number: QTBUG-46116
Change-Id: I0f33be849513a2debaf8c093dcd413fa09b5c681
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2017-10-11 09:35:05 +00:00
Tony Sarajärvi
9909ff108e Fix blacklisting of tst_QOpenGL in Windows
Commit ba1b73175b tried
blacklisting this autotest in Windows 7 only. This however
does not work. We can't pin point blacklisting to a specific
Windows version.

Task-number: QTBUG-63122
Change-Id: I5edb5b56fd86ad194214818a838db9cfd6be2ad1
Reviewed-by: Simo Fält <simo.falt@qt.io>
2017-10-10 07:42:33 +00:00
Tony Sarajärvi
e28fd642a9 Extend blacklisting of tst_gestures in RHEL
This autotest has been blacklisted already in RHEL 7.1
and RHEL 7.2. This one extends it to 7.3 and 7.4.

Task-number: QTBUG-52523
Change-Id: I3e2d8cd882d9f7dc58a65bde88e3aa16438b13c3
Reviewed-by: Simo Fält <simo.falt@qt.io>
2017-10-10 07:42:24 +00:00
Mårten Nordheim
a402b3a02e Add support for HTTP status 308 Permanent Redirect
308 Permanent Redirect was introduced after redirection support was
initially added to Qt.

[ChangeLog][QtNetwork][QNetworkAccessManager] Added support for HTTP status 308.

Task-number: QTBUG-63075
Change-Id: I1c6cda331d776237113ef8854de9abfe7e41ed3e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-10 07:06:24 +00:00
Thiago Macieira
f27e029ef2 Autotest: use _exit() instead of exit() to simulate an unclean exit
We're not going to crash to avoid core dumps getting recorded by
systemd, filling up filesystems or showing dialog boxes. We just need to
exit without running destructors. Now, exit() isn't supposed to run
function-scope destructors, so just in case we use _exit().

Change-Id: I0b48fc8e90304e0dacc3fffd14e909ff248ce1a1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-08 06:41:05 +00:00
Giuseppe D'Angelo
cb08b40976 Move detection of <future> to a configure test
<future> is needed by QThread::create. Instead of a fragile series
of preprocessor tests, move its detection to a configure test.
This dramatically simplifies the code, but on the other hand ties
the availability of QThread::create() to the system used to compile
Qt (rather the one used to compile an application).

Change-Id: If1b06363379bf29126cfa68f2a0651cbb78a67f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-06 05:51:54 +00:00
Thiago Macieira
f62768d046 QUrl: re-fix the setPath("//path") case leading to scheme://path
Commits aba336c2b4 (in Qt 5.2) and
aba336c2b4 (in 5.6) both tried to deal
with this problem, with different levels of success. This is the third
attempt (and hopefully the charm).

Instead of modifying the path that the user provides, go straight ahead
and declare it invalid. This is supported by RFC 3986, which declares
this expansion impossible:

   relative-part = "//" authority path-abempty
                 / path-absolute
                 / path-noscheme
                 / path-empty
   path-abempty  = *( "/" segment )
   path-absolute = "/" [ segment-nz *( "/" segment ) ]
   path-noscheme = segment-nz-nc *( "/" segment )

The "path-abempty" and "path-noscheme" cases are the two issues we
already handle. This commit adds the third one: path-absolute, which
requires that the first segment of the path be of non-zero length.

That is, it is now possible again to have http://example.com//path
constructed piece-wise, without it producing http://example.com/path.
Additionally, it catches the case of http://example.com//path parsed
from full URL then followed by setAuthority("").

Change-Id: I69f37f9304f24709a823fffd14e67a5e7212ddcd
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-06 03:49:40 +00:00
Tor Arne Vestbø
08e083e682 Ensure result of all QTest::qWaitFor are verified
The qWaitFor functions themselves can not trigger a test failure, as that
will not result in the test function exiting early, so every single call
to qWaitFor needs to be wrapped in a QVERIFY.

Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-05 15:15:36 +00:00
Liang Qi
7bbb9a8ce8 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-05 12:38:45 +00:00
Milla Pohjanheimo
2755e02f07 Increase timeout for tst_QXmlSimpleReader::inputFromSocket() test
The test tst_QXmlSimpleReader::inputFromSocket() is failing with
"QTestLib: This test case check ("(((server->listening)))") failed
because the requested timeout (5000 ms) was too short, 11700 ms would
have been sufficient this time".
Increased the timeout, since it's better to wait than to fail.

Task-number: QTBUG-63539
Change-Id: I804549648ea834e41d3c87871f5bab90f209385c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-05 10:22:12 +00:00
Svenn-Arne Dragly
ba423261cd Improve performance in QThreadPool
When many runnables are executed, this improves the
performance by not resizing the queue for each runnable,
which was the case in the previous version, because of
many calls to QVector::takeFirst().

Also add a test that makes sure tryTake() is safe to
call and does not leave the queue in a bad state that
tries to use nullptr entries.

Change-Id: I608134ecfa9cfc03db4878dcbd6f9c1107e13e90
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-10-04 12:00:33 +00:00
Gatis Paeglis
d7c57fa68e tests: un-blacklist tst_QMenuBar::taskQTBUG4965_escapeEaten
We can't qWaitForWindowExposed on native menu bars. Other test
functions in this file are already disabling the native manu bar.

Task-number: QTBUG-24326
Change-Id: Iecf907ca84589159417d0d942c911485a41af164
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-10-04 11:41:55 +00:00
Liang Qi
bc5f45052f Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/corelib/global/qglobal.h
	src/corelib/tools/qcryptographichash.cpp
	src/corelib/tools/qcryptographichash.h
	src/corelib/tools/qmessageauthenticationcode.cpp
	src/plugins/platforms/windows/qwindowswindow.h
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST

Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
2017-10-04 13:41:04 +02:00
Richard Moe Gustavsen
b4981f9d4c Widgets: change QWidget::setTabOrder to understand compound widgets
A "compound widget" is a widget that has a focus proxy set to an inner
child. This is normal for complex black-box components where focus handling
is delegated to the children. Since the compound can have several
children, a local tab order might exist between them.

The current implementation of setTabOrder had no idea about
compound widgets. As such, when connecting two compounds in the
tab chain, it would just break up their inner tab order and
cause tabbing to ignore children other than the proxy.

The new implementation recognizes compound widgets, and add some
extra code to figure out the correct tab targets. This way, the
local tab order between the children will be preserved.

This implementation was inspired by the patches of Marek Wieckowski posted
in the linked bug report, and later modified by Nikita Krupenko.

[ChangeLog][Widgets] QWidget::setTabOrder() will now preserve the local
tab order inside a widget if it has a focus proxy set to an inner child.

Task-number: QTBUG-10907
Change-Id: I0673d39d70ec8c6bf64af30bf978d67c651b2f3c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-04 11:27:18 +00:00
Timur Pocheptsov
3faf8f4d48 tst_QSsl(longlongnamefollows) - fix a flakey auto-test
The original test was using QSslSocket::waitForEncrypted function, which
is apparently a bad idea on Windows: connecting to 'www.qt.io' we have
to verify certs and there is no guarantee a given Windows VM has the required
CA certificate ready in its cert store. In such cases we start a background
thread (aka CA fetcher's thread) and it calls a (potentially blocking for
a significant amount of time) function (CryptoAPI). When finished, this
thread reports the results via queued connection, which does not work
if we are sitting in a tiny-loop inside waitForEncrypted. Re-factor
the test to use signals/slots and a normally running event loop.
Also, the last test makes a wrong assumption about Windows - fixed.

Task-number: QTBUG-63481
Change-Id: I4abe9cda2a6c52d841ac858cccb6bf068e550cb8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-03 16:37:30 +00:00
Mårten Nordheim
8b64a1054a Fix cookies not being applied on redirect
Task-number: QTBUG-63313
Change-Id: I5245fc837557f19062cbbf0f1dfb86353c85229f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-29 14:44:13 +00:00
Tor Arne Vestbø
c3e93391ee qmake: Allow non-bundle apps and libs to have an Info.plist
Change-Id: I5fe5c8d3214876520b5259d478ac9ef887c61e95
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-09-29 10:08:08 +00:00
Jake Petroules
7fd3cc3980 Clean up OS version checks for Apple platforms
Convert QSysInfo/QOperatingSystemVersion to __builtin_available where
required or possible, or to QOperatingSystemVersion where
__builtin_available cannot be used and is not needed (such as negated
conditions, which are not supported by that construct).

Change-Id: I83c0e7e777605b99ff4d24598bfcccf22126fdda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-29 03:30:13 +00:00
Paul Olav Tvete
ff2e9a17e7 Fix crash when reparenting window container
QWindowContainer assumed that a widget could never change from
native to non-native. This is not a fact when the window container
is reparented to toplevel and back. In this case, usesNativeWidgets
would be stuck at true, and parentWasChanged() would go down the
native widget path, triggering an assert.

The solution is to always recalculate the usesNativeWidgets bool.

Task-number: QTBUG-63168
Change-Id: I88178259878ace9eb5de2ee45ff5e69b170da71c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
2017-09-28 12:09:27 +00:00
Tony Sarajärvi
e96c56c740 Blacklist tst_QWindow:testInputEvents on RHEL 7.4
Swapping from RHEL 7.2 to 7.4 produces new autotest failures.

Task-number: QTBUG-63433
Change-Id: I3e59aa73b5874cfec06e166f521e06b0c7829743
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-27 18:46:51 +00:00
Thiago Macieira
f7350ac99e Improve qustrlen further by avoiding the alignment prologue
This avoids looping prior to the main 16-byte loop, by performing one
load that may include bytes prior to the start of the string. This is
guaranteed not to fault, since str points to a valid character, but it
may cause Valgrind to print warnings.

Change-Id: I6e9274c1e7444ad48c81fffd14dcae854bba24b2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-26 18:19:35 +00:00
Paul Olav Tvete
35781b3588 Return focus to correct widget after showing menu
By the time we call setKeyboardMode(true), the menu may
already have taken focus. This change sets keyboardFocusWidget
before opening the popup, and makes sure that keyboardFocusWidget
is not set to the popup. (We cannot remove the assignment from
setKeyboardMode(), since it's called from several places.)

[ChangeLog][QtWidgets] Fixed widget losing focus after showing
menu second time.

Task-number: QTBUG-56860
Change-Id: Ic01726bf694e6f365dd7b601ad555156e0fdf6c5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-09-26 13:38:06 +00:00
Tor Arne Vestbø
49154acde3 macOS: Deliver NSWindow notifications to all windows, not just top level
Child QWindows (or in the case of QWindows embedded in native applications:
top level QWindows where the corresponding NSView is a child of another
view, so not being the contentView of its window), still need some of the
NSWindow notifications to e.g. update their exposed state when the window
becomes visible.

We make sure to send the notification to all QCococaWindow children of
the relevant NSWindow, and let each callback decide if it should only
apply to content views.

This fixes an issue where a QWindow would never be exposed if the window
was a child NSView and added to a NSWindow that was yet to be shown.

Change-Id: I7f7df8bc5f4ca3ac553a2c146f8c3229b197c059
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-09-26 12:50:05 +00:00
Gatis Paeglis
542e11ab2b tests: make exposeEventOnShrink_QTBUG54040 not flakey on xcb
From: https://tronche.com/gui/x/xlib/events/exposure/expose.html

"The circumstances in which the X server generates Expose events
are not as definite as those for other events."

On windows with XCB_GRAVITY_NORTH_WEST flag set we should not get
expose events according to e2665600c0,
but as stated earlier this might not always be true.

Nevertheless, sometimes we get expose event from X server when shrinking
window, but most of the time we don't. Make the test not flakey by
checking that we get at least 1 expose event, instead of exactly 1.
Now running test 500 times in a loop does not fail.

Task-number: QTBUG-63424
Change-Id: I8004e622020cc09e11b7d592faf6d9ee1b9cfee2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-09-26 12:49:59 +00:00
Richard Moe Gustavsen
0dbede2b17 Widgets: be able to tab to a widget that has a focus proxy
When tabbing/searching for the next focus widget, the current
code would check if the next widget in the focus chain
had a focus proxy, and if so, ignore it. The exact reason
for this behavior is not clearly understood, but some widgets
(e.g QSpinBox) has children (a QLineEdit) that sets the parent
as focus proxy. If we didn't ignore children with focus proxy, tabbing
from a QSpinBox would lead us to find the inner QLineEdit, which
(because of its proxy), would lead us back to the QSpinBox. And
therefore not be able to tab out.

But ignoring the focus proxy has other problems. Normally a focus
proxy is the next sibling to the widget it acts as a proxy for, and
tabbing to the widget will therefore appear correct. But if the
focus proxy is not the next sibling, the logic will fail, since
the tab would anyway give focus to the next sibling. This becomes very
apparent if the focus proxy is a child of the widget, since then
its likely that the focus proxy is not the _first_ child among all
the children. So tabbing to the parent would not give focus to
the proxy.

This patch will change this logic so that you are allowed to tab to a
widget with a focus proxy. But we check that if you do so, you actually
end up moving focus in the right direction. If not, we ignore it like
before. This will ensure that we tab correctly when dealing with focus
proxies, and especially when focus proxies are used to construct
compound widgets.

[ChangeLog][Widgets] When tabbing to a widget with focus proxy, focus
will now be given to the proxy rather than just being ignored.

Task-number: QTBUG-10907
Change-Id: I66d1da5c941fdd984bb2783cc355ca65b553b5dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-09-25 07:18:37 +00:00
Thiago Macieira
9467ebcf15 Autotest: centralize the detection of IPv6 support
I'll need it again in the next commit.

Change-Id: I209fcd5dbc2b4e5381cffffd14df65dcee71ca7e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-25 05:38:27 +00:00
Thiago Macieira
282065d443 QRandomGenerator: update API to better name
"generate" is better than "get", and we already have "generate(it, it)"
which uses std::generate(). This changes:

 - get32()    →   generate()
 - get64()    →   generate64() and QRandomGenerator64::generate()
 - getReal()  →   generateDouble()

Change-Id: I6e1fe42ae4b742a7b811fffd14e5d7bd69abcdb3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-22 15:29:42 +00:00
Shawn Rutledge
bcdd07ceb8 Blacklist tst_QItemDelegate::enterKey tests on openSUSE 42.3
Task-number: QTBUG-62967
Change-Id: Ifce1c8732e126e26636057de29e1fe6348c914bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-09-22 14:34:30 +00:00
Gabriel de Dietrich
4c025ca9c7 QCompleter: Send activated() signal only once on return key
Due to the complex event forwarding logic between QCompleter,
QComboBox, QLineEdit and QWidgetLineControl, in some cases the
same single user return key press could result in duplicated
activated() signals being emitted by QComboBox. The first one
would be emitted because QLineEdit emitted editingFinished()
as a result of QCompleter::eventFilter() having forwarded the
return key press event to QComboBox. The second one, would
happen right after, as QCompleter::eventFilter() would process
the same event on behalf of its popup.

(We recall that QCompleter is installed as its own popup event
filter. That's also the case for the completer's widget, although
the purpose there is limited to focus-out events).

The current fix consists on skipping the emit as a result of
QLineEdit::editingFinished() if the completer's popup is still
active. For this to be accurate, it helps to test whether the
completer's popup is visible, so we will not be hiding it in
QWidgetLineControl::processKeyEvent() anymore. Indeed, we know
that if the popup is visible, that means that processKeyEvent()
was called after being forwarded by the completer's popup event
filter. Furthermore, the popup will be hidden by its event filter
shortly after it returns from said event forwarding call.

Based on a patch by Alexey Chernov <4ernov@gmail.com>.

Task-number: QTBUG-51858
Task-number: QTBUG-51889
Change-Id: I013f6c3000ae37b5b0ec20eaf5cf7746c9c903e3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-09-22 00:02:06 +00:00
Liang Qi
e5114e10dc Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-09-21 06:55:09 +00:00
Thiago Macieira
92ca09147f Restore compatibility with pre-5.9 Keccak calculation
Commit 12c5264d9a fixed the calculation of
SHA-3 in QCryptographicHash: we were previously calculating Keccak.
Unfortunately, turns out that replacing the algorithm wasn't the best
idea: there are people who need to compare with the result obtained from
a previous version of Qt and stored somewhere. This commit restores the
enum values 7 through 10 to mean Keccak and moves SHA-3 to 12 through
15. The "Sha3_nnn" enums will switch between the two according to the
QT_SHA3_KECCAK_COMPAT macro.

[ChangeLog][Important Behavior Changes] This version of Qt restores
compatibility with pre-5.9.0 calculation of QCryptographicHash
algorithms that were labelled "Sha3_nnn": that is, applications compiled
with old versions of Qt will continue using the Keccak algorithm.
Applications recompiled with this version will use SHA-3, unless
QT_SHA3_KECCAK_COMPAT is #define'd prior to #include
<QCryptographicHash>.

[ChangeLog][Binary Compatibility Note] This version of Qt changes the
values assigned to enumerations QCryptographicHash::Sha3_nnn.
Applications compiled with this version and using those enumerations
will not work with Qt 5.9.0 and 5.9.1, unless QT_SHA3_KECCAK_COMPAT is
defined.

Task-number: QTBUG-62025
Discussed-at: http://lists.qt-project.org/pipermail/development/2017-September/030818.html
Change-Id: I6e1fe42ae4b742a7b811fffd14e418fc04f096c3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-21 03:21:58 +00:00
Edward Welbourne
e0c2d328b1 Fix #if-ery and accompanying comment
The comment was back-to-front on the meaning it needed to address; and
the #if-ery used a deprecated define, now changed to match what
sanity-bot asked for.

Change-Id: I0a971ab2e405e5908066da86964d67c8b852f114
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-20 11:50:47 +00:00
Tony Sarajärvi
30a6557eb0 Blacklist tst_QItemDelegate::testLineEditValidation in openSUSE 42.3
This autotest is blacklisted as it is deemed flaky.

Task-number: QTBUG-63262
Change-Id: I216985e81d1c1cb3528fd8a005be48cad2a31ab7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-09-20 10:06:34 +00:00
Tony Sarajärvi
bbaedb9744 Blacklist flaky QItemDelegate tests in openSUSE 42.3
Task-number: QTBUG-62967
Change-Id: I05cbf06f068701ee16b54e7052e02becc0c47702
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-09-20 10:06:28 +00:00
Liang Qi
01bc69f99f Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/styles/mac/qmacstyle_mac.mm
	src/widgets/util/qcompleter.cpp
	src/widgets/widgets/qmainwindowlayout.cpp
	src/widgets/widgets/qmdisubwindow.cpp

Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
2017-09-20 11:58:32 +02:00
Tony Sarajärvi
bf41fbb233 Blacklist tst_QGraphicsScene::isActive in openSUSE 42.3
This autotest is blacklisted as it is deemed flaky.

Task-number: QTBUG-63260
Change-Id: I3e83bcb0dbbe4fbf9d5c16f764fbeeca2b52d10c
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2017-09-20 09:48:36 +00:00
Andy Shaw
35bb55cd12 Itemviews: Set the WA_InputMethodEnabled attribute correctly
When focus is put back onto an itemview and the current item is editable
then the WA_InputMethodEnabled attribute should be set. Likewise this
should be set/unset when the current index changes too, depending on
whether the index is editable or not.

Change-Id: Iaea075e669efd21bdaa89a49c500c449272d098b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-09-20 07:37:35 +00:00
Andy Shaw
3c95c748e0 Fix recordOCI() test to treat clob/nclob as QByteArray
Change-Id: I0315b23dad66f98fc681c624d4afa8b5abb54a7b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-18 21:06:49 +00:00
Andy Shaw
2d168af7d7 OCI: Use correct type for getting doubles
Change-Id: Iffb81a37a517e58d48757d82f93f20e8c5100033
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-18 21:06:42 +00:00
Jake Petroules
83122b1932 Remove unnecessary VxWorks ifdef
Change-Id: Ie655bdff9a09c6060f66e4346b94ba52443241f4
Reviewed-by: Tuomas Heimonen <tuomas.heimonen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-18 21:06:25 +00:00
Jake Petroules
69b16a46e8 Exclude QSystemSemaphore test with -no-feature-systemsemaphore
Change-Id: I9db6b68c3d26b27a0203c68c48ab73602eb15095
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-09-18 08:56:53 +00:00
Jake Petroules
2740b9d668 Use QT_LSTAT instead of lstat directly
Not all platforms (such as VxWorks) have lstat.

Change-Id: If42f0041f9a6d9bec0a355173c88f28f1819bd57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-15 20:52:23 +00:00
Jake Petroules
7127202358 Exclude tst_QDir::mkdirOnSymlink on Unix platforms without symlinks
One example is VxWorks.

Change-Id: I253df715a9417c1f9cede79b1e1860924e0da8a9
Reviewed-by: Tuomas Heimonen <tuomas.heimonen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-15 11:20:32 +00:00
Jake Petroules
ceffc7e0e7 Exclude DBus performance test with -no-feature-process
Change-Id: I3e650b21139bd59b1f8386f4abb39aadf85e412f
Reviewed-by: Tuomas Heimonen <tuomas.heimonen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-15 11:20:21 +00:00
Thiago Macieira
5d48143ff8 Autotest: use QUdpSocket instead of QTcpSocket in tst_QNetworkInterface
We don't need to bother the network test server with a TCP SYN packet.
All we need is for the local operating system to figure out the IP
address it would use to send a packet to the test server. We can do that
with QUdpSocket.

Also, the network test server hasn't been called "fluke.troll.no" for
almost a decade.

Change-Id: I209fcd5dbc2b4e5381cffffd14df65ccc7133247
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-14 13:17:02 +00:00
Allan Sandfeld Jensen
590e71a69c Fix convertToFormat with color-tables
The function was only well defined from RGB32 and ARGB32PM formats,
this patch fixes it so it behaves well from all formats.

Task-number: QTBUG-63163
Change-Id: Id892531d9aaf997b707b430196c1166493792a2a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-09-14 08:13:46 +00:00
Thiago Macieira
84fcc38955 Autotest: when using libproxy, QNetworkProxyFactory isn't generic
Looks like whoever created the blacklist never tried to figure out why
it happened.

Change-Id: I84e45059a888497fb55ffffd14d2fb29e32a4521
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-13 18:42:44 +00:00
Mårten Nordheim
1394610c79 Workaround for proxyChange failing when run alone
The issue itself is not really worth fixing (the very first request
being supposed to have a different proxy than any of the other
following requests before a session has been initiated), but we can
at least make the test pass when it is run alone.

Task-number: QTBUG-63134
Change-Id: I6c7df5c5653541031811e6bff562572061afae0f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-13 18:42:30 +00:00
Thiago Macieira
3b61cd6ad7 QStringView: De-inline the length calculation so we can use SSE2
Performance is more important in this case than the theoretical benefit
of constexpr. This commit implements the SSE2 search for 16-bit null and
it might be possible to implement the equivalent for AArch64
(investigation required). It also adds a fallback to wcslen() for
systems where wchar_t is short (non-x86 Windows or 32-bit x86 build with
-no-sse2).

We can re-add the constexpr loop once the C++ language has a way of
overloading constexpr and non-constexpr. GCC has a non-standard way to
do that with __builtin_constant_p, which is also implemented in this
commit, but note that the inline function is still not constexpr.

Change-Id: I6e9274c1e7444ad48c81fffd14dcaacafda5ebdc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-13 16:19:45 +00:00
Stephan Binner
bef8b905af Convert features.sizegrip to QT_[REQUIRE_]CONFIG
Change-Id: Ieac4ae1f0b8b84e943c00da9903346a44e57138c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-09-12 18:12:47 +00:00
Tony Sarajärvi
ba1b73175b Blacklist tst_QOpenGL autotest in Windows 7
Task-number: QTBUG-63122
Change-Id: Idb4c84800265c2e446d27516261fcc418be7863b
Reviewed-by: Joni Jäntti <joni.jantti@qt.io>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2017-09-12 07:15:25 +00:00
Tor Arne Vestbø
d2a988512e macOS: Detect use of heap-allocated QMacAutoReleasePool
QMacAutoReleasePool is backed by an NSAutoreleasePool, which documents that
"you should always drain an autorelease pool in the same context (invocation
of a method or function, or body of a loop) that it was created".

This means allocating QMacAutoReleasePool on the heap is not a supported
use-case, but unfortunately we can't detect it on construction time.

Instead we detect whether or not the associated NSAutoreleasePool has been
drained, and prevent a double-drain of the pool.

Change-Id: Ifd7380a06152e9e742d2e199476ed3adab326d9c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-08 12:05:21 +00:00
Gatis Paeglis
1af927976a tests: fix and un-blacklist tst_qgraphicsview::hoverLeave
Tests should not use QCursor to emulate mouse move, see QCursor::setPos() docs.

The flakiness of the test on XCB is not surprising when the test queries geometry
even before the window has been shown. With the re-factored version I could not
reproduce flakiness anymore.

Removed Q_OS_MAC and closed QTBUG-26274 as test passes on macOS from which I
assume that the underlying issue has been fixed.

Removed Q_OS_QNX ifdef as test does not rely on QCursor anymore.

This patch also fixes the issues on minimal / offscreen platform plugins.
QCursor::setPos() is evil for auto test purposes.

Note:

We intentionally use QTest::mouseMove(QWindow *window, ..), not the QWidget overload.
The QWindow version gets routed through QWSI, which ensures that all necessary events
are generated as expect. In QWidget code path this is currently disabled by
QTEST_QPA_MOUSE_HANDLING.

Change-Id: I285c26cff09e3f2750f8c2abbb1f46c8f7be984a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-09-07 15:16:46 +00:00
Liang Qi
19dd2ca93b Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	examples/opengl/qopenglwidget/main.cpp
	src/3rdparty/pcre2/src/pcre2_printint.c
	src/plugins/platforms/cocoa/qnsview.mm
	src/widgets/widgets/qcombobox.cpp

Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
2017-09-06 13:26:31 +02:00
Friedemann Kleint
3b6fb8f22e Use QTRY_COMPARE in tst_qwidget::activation() (Windows only)
Speeds up the test from approximately 770ms to 180ms.

Change-Id: I2e5479fd5190b841b44d4a66380d27b1c3b55162
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-06 10:28:02 +00:00
Stephan Binner
c6b9c6e5f2 Convert features.socks5 to QT_[REQUIRE_]CONFIG
The sources were already added conditionally in the project file since
179fe5981f.

Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-09-06 06:50:54 +00:00
Tony Sarajärvi
f9fea20c10 Extend blacklisting of tst_QWidget::maskedUpdate to openSUSE 42.3
Task-number: QTBUG-51399
Change-Id: I7fcc52da2ce539251f6bad0394c4580dd76439a7
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2017-09-04 12:11:47 +00:00
Tony Sarajärvi
a2dbf1e779 Blacklist tst_QItemDelegate::enterKey tests on openSUSE 42.3
Task-number: QTBUG-62967
Change-Id: I42f25120f1a9e2ef6a9a147e4f36edcdff2922a6
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2017-09-04 12:11:44 +00:00
Stephan Binner
093064fdeb Convert features.completer to QT_[REQUIRE_]CONFIG
Change-Id: If45a46c08b37d245229a39f3d6ffbb34154934f2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-09-04 11:28:02 +00:00
Orgad Shaneh
ced0f54ec3 Fix resolution of relative links on Windows
[ChangeLog][QtCore][QFileInfo] Relative symbolic links on Windows are
now resolved to their absolute path by symLinkTarget().

Task-number: QTBUG-62802
Change-Id: I5826517130bd389aef994bf3f4b6d99b2a91b409
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-09-04 07:35:09 +00:00
Frederik Gladhorn
9831118378 Merge dev into 5.10
Change-Id: I5fb5e7e6e57bb5db6fcb1f670f7f6cbc8def2d60
2017-09-02 10:27:09 +02:00
Thiago Macieira
b5d471d0c2 QNativeSocketEngine: disable unused methods about OS socket buffer
They aren't used in the API, so let's stop wasting library size.

Change-Id: I6e9274c1e7444ad48c81fffd14db247ecf825a57
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-01 16:40:36 +00:00