Commit Graph

34103 Commits

Author SHA1 Message Date
Timur Pocheptsov
0f0726d36e QSslSocketPrivate (SecureTransport) - add ALPN support
Starting from iOS 11.0 (SDK) Apple has exposed two new functions:
SSLSetALPNProtocols and SSLCopyALPNProtocols. This allows us to
negotiate http/2 (and any other application layer protocol) via TLS on
iOS. Unlike OpenSSL, SecureTransport's version is very limited - we
have to compare protocols manually after the SSL handshake has
finished. Still, this is better than nothing. These two functions are
also declared in macOS SDK starting from 10.13, but unfortunately the
symbols are missing and for now this feature is only enabled on iOS.

Change-Id: I3ed2f287bfa864f8aca0c231171e804f7d6b8016
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-14 16:12:51 +00:00
Alexander Volkov
094869d4a8 QDirIterator: Skip inconvertible file names on Unix
In the case when user's local encoding is UTF-8, QDirIterator
may list entries which names can't be correctly converted from
UTF-8 to UTF-16, e.g. for "\xC0\xB0" file name QDirIterator::fileName()
returns "\uFFFD\uFFFD" (FFFD is a code of Replacement Character).
The problem is that you can't do anything with such directory
entries because there is no way to get the original entry names.

List only those names that can be converted to QString
and then back to the local encoding without corruption.

Change-Id: Ib6a71dea8ce9601876040c07276c325fd997e767
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-14 15:55:06 +00:00
Jan Grulich
c35c017a6c Add support for flatpak portals
Adds support for OpenURI and Email Flatpak portals. To support them we
just do specific DBus calls, which are then caught and forwarded by
xdg-desktop-portal daemon/service. This is needed for Qt applications
running in sandbox, otherwise they cannot open links or email clients
inside sandbox. Other portal support, like for opening files can be
added into a platform theme, but adding support for OpenURI and Email
portal requires writing custom platform services plugin and this is only
possible when you write complete platform plugin, thus we want to have
this support directly in Qt. Support for other portals will most likely
follow soon, but at this moment we have to get rid of creating our
custom platform plugin to just have our own platform services for
flatpak support.

[ChangeLog][Platform Specific Changes][Linux] Added support for flatpak
portals. Flatpak is a software utility for software deployment and
package management. It provides a sandbox environment in which users
can run applications in isolation from the rest of the system. To
communicate with the system flatpak uses portals, which are designed to
be a bridge between sandboxed applications and desktop/system running on
user's computer. Flatpak runs automatically this as service, called
xdg-desktop-portal, which exports portals on DBus and which are by
default visible to all applications running under Flatpak.

Change-Id: Ice57ad120d30a3154b133172c79d8e9d6e61bd4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-14 15:55:01 +00:00
Thiago Macieira
772863355a QLockFile/Unix: save the boot and machine IDs in the lock file too
This allows us to make sure that the PID we read is from the same boot
as we are right now running. The collision could happen on embedded
systems where the boot sequence is fixed, so all the same processes
would have the exact same PIDs after reboot as they did before.

[ChangeLog][QtCore][QLockFile] QLockFile can now properly conclude that
a lock file from a previous boot of the same device is stale and can be
removed. This is implemented only for Linux and Apple operating systems.

Task-number: QTBUG-63425
Change-Id: I0b48fc8e90304e0dacc3fffd14e8e3a197211788
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-11-14 15:54:56 +00:00
Thiago Macieira
68cad0ef99 QSysInfo: Remove the caches in {boot,machine}UniqueId()
Looks like there are conditions in which they could be used during shut
down and thus access an already-destroyed static. This was tested in
test tst_lockfile.cpp:LockFileUsageInGlobalDtor.

Change-Id: I57a1bd6e0c194530b732fffd14f4dae39ab1ae2c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-11-14 15:54:53 +00:00
Thiago Macieira
aaa187cd99 QAbstractSocket: Add socketOption for the Path MTU
This allow retrieving the value of the known PMTU for the current
socket. This works on Linux (IPv6 and IPv4) and FreeBSD (IPv6 only) --
the other OSes don't have the necessary API.

Note: do we need add IP_MTU_DISCOVER?

Change-Id: I6e9274c1e7444ad48c81fffd14dcaf97a18ce335
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-14 15:54:51 +00:00
Thiago Macieira
aa494d826a QNetworkInterface/Win: fix MTU of Windows loopback interfaces
We document that -1 is not a valid value. The Windows structure's type
is unsigned, so the value is actually ULONG_MAX.

Change-Id: Ic632b4163d784b83951cfffd14f668645c4da3a9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-14 15:54:49 +00:00
Thiago Macieira
9db46732a8 Make qsimd_p.h compile in C mode too
Since we very often need to write our intrinsic-using code in C to avoid
"leakage" of not-inlined inline functions, this file is very handy.

Change-Id: I57a1bd6e0c194530b732fffd14f45d27a32538f8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-11-14 15:54:47 +00:00
Bernhard M. Wiedemann
38271e9298 Allow to override resource file date
because some packages create resource input files at build time
and thus get the build date embedded in binaries,
so that they differ for each build.

See https://reproducible-builds.org/ for why this matters
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Task-number: QTBUG-62511
Change-Id: I8908ac6182fab066e6ea398df2567f6d050c77e7
Reviewed-by: hjk <hjk@qt.io>
2017-11-13 16:00:34 +00:00
Tor Arne Vestbø
3e4d3209b2 macOS: Remove unused method QCocoaWindow::nativeWindowGeometry
Its usage was removed in ef32f16fc2.

Change-Id: I5101131e401e615231ab05b241dd5b670f6a5a61
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-11-13 15:22:38 +00:00
Tor Arne Vestbø
fddcb19de1 Fix spelling issues in qhighdpiscaling.cpp
Change-Id: I4ca5a2e79ff88a664505273d2a9f38b1b499076c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-11-13 15:22:36 +00:00
Liang Qi
a71fdceae2 Add a missing semicolon in painting/qdrawhelper_neon.cpp
This amends f8807b8220.

Q_PROCESSOR_ARM_64 was only tested in qt5 integration.

Task-number: QTBUG-64393
Change-Id: I4471c2db3dc07e47e1825c2539c32c4d2a073396
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-11-11 07:50:39 +00:00
Ulf Hermann
9bd30943ba Add a feature for DNS lookup support
Exclude the relevant files from being built if it is disabled, and add
QT_REQUIRE_CONFIG(dnslookup) to the headers.

Change-Id: I3af298dc87d63c93f724928dd1135c20eba33045
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-11-08 14:45:30 +00:00
Tor Arne Vestbø
b0c895fa7a macOS: Simplify helpers for flipping between quadrant I and IV
The different flip-functions have been replaced by a single function,
qt_mac_flip, with overloads for points and rects. This function is
primarily used to implement QCocoaScreen::map(To|From)Native, which
most clients of qt_flip* have been moved to. This makes it clearer
what kind of reference geometry we're flipping in relation to, and
simplifies call-sites.

Change-Id: I8a0862f94bb2c64a83a1c3168f984a195c0af6db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-11-08 14:39:52 +00:00
Allan Sandfeld Jensen
f8807b8220 Expand ARGB32ToARGB32PM to also work on 32-bit ARM neon
Replaced two AArch64 specific instructions with 2-3 instruction
replacements from ARM32.

Change-Id: I5cbbda5afdaabea52babaaf8e5cc57262d897159
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-11-08 11:44:13 +00:00
Tor Arne Vestbø
b254b03dc3 Deprecate QDesktopWidget in favor of QScreen
[ChangeLog][QtWidgets] QDesktopWidget has been deprecated. Use the
corresponding QScreen functions instead.

Task-number: QTBUG-62094
Change-Id: I0941d2aa27a06ec650ca52d6467e5bfb0ad43459
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-11-08 11:39:38 +00:00
Andreas Hartmetz
eeca8895fc Remove obsolete DBus dispatch lock
In c2049f67e4, all DBus I/O was
moved into a service thread. The dispatch lock used to protect
DBus I/O in the threading setup before that commit. It is not
needed anymore.
No discernible difference in QtDBus benchmarks, roughly 500
bytes code size reduction on AMD64. The main point is to reduce
confusion from unnecessary code.

Change-Id: Idcbdd2b7e2b317cf6da0b5bfc5ec70afed1f1b48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-08 05:38:39 +00:00
Tor Arne Vestbø
bfcad18526 macOS: Replace deprecated CGDisplayIOServicePort function
There's no replacement function from Apple's side, so we have to iterate
the available displays and pick the right one based on the vendor, product
and serial number.

Change-Id: I437bee06bc6826c3214a701cd2c65f6109eeb3e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-11-08 00:55:35 +00:00
Tor Arne Vestbø
f1aa2ee512 macOS: Disable CUPS PPD deprecation warnings for QCocoaPrintDevice
We're not going to rewrite this code until we can also share the rewrite
with QPpdPrintDevice, which can only happen once we drop support for
RHEL 6, which still ships CUPS 1.4.

Until then, silence these deprecation warnings so that they don't add
noise to other potential build warnings/issues. This matches the
approach taken by Chromium in crbug.com/622493.

Task-number: QTBUG-56545
Change-Id: Ia308ae1e8064dc046745350b0be3992d02f2b760
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-11-08 00:55:27 +00:00
Tor Arne Vestbø
7646f18295 Enable deprecation warnings for Qt plugins, just like for modules
We want to know when a plugin uses deprecated Qt APIs, especially
deprecations in the QPA APIs, which today is not the case, so
platform plugins have no idea that they should transition.

Change-Id: If9d3d95dc6f1f4178b103f177c9eb8326767ffab
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-11-08 00:55:20 +00:00
Thiago Macieira
05012f4285 QNetworkInterface: add MTU
[ChangeLog][QtNetwork][QNetworkInterface] Added maxTransmissionUnit().

Change-Id: Iaf4157b7efa2416d898cfffd14d96b2970d6af87
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-07 22:15:39 +00:00
Thiago Macieira
18ec85a80c QNetworkInterface: Add the DNS eligibility
[ChangeLog][QtNetwork][QNetworkInterface] Added dnsEligibility() to
QNetworkAddressEntry to indicate whether the address is eligible or not
for publication in DNS or similar mechanisms.

Change-Id: Id3ae5f853d964358ac1ab19b525334a426e0e052
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-07 22:15:38 +00:00
Thiago Macieira
a93437342b QNetworkInterface: add support for extracting address lifetime
[ChangeLog][QtNetwork][QNetworkInterface] Added preferredLifetime() and
validityLifetime() to QNetworkAddressEntry that report the remaining
lifetime of the address in the network interface.

Change-Id: I292b84e2193979446e43344b0727642812cba630
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-07 22:15:35 +00:00
Thiago Macieira
5193ab97f4 QNetworkInterface: Add type()
[ChangeLog][QtNetwork][QNetworkInterface] Added type().

Change-Id: I7de033f80b0e4431b7f1ffff13f9a5592b5776e1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-07 22:15:33 +00:00
Thiago Macieira
4d31fc919b QNetworkInterface: add a Linux backend directly using AF_NETLINK
This allows us a lot greater detail in getting information than relying
on getifaddrs() function. It is also the only way of getting some extra
information we'll need in the future, like address lifetimes.

The parser will also be helpful if we want to add a network interface
monitor in the future, though I currently have no clue how to do the
equivalent on macOS and Windows.

This commit does not remove the support for getifaddrs() on Linux, but I
will no longer add features to it. Note that Android does not support
getifaddrs(), so this may be an improvement if AF_NETLINK works there.

Change-Id: I3868166e5efc45538544fffd14d8e6f993e1eb91
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-07 22:15:32 +00:00
Timur Pocheptsov
16b76456be QSsl: use QT_CONFIG(feature) instead of hardcoded constant
The test OPENSSL_VERSION_NUMBER >= 0x1010000000L was introduced before
1.1 support. Now a couple of conditional inclusions can be converted
into QT_CONFIG(opensslv11).

Task-number: QTBUG-64275
Change-Id: I627e6b06f334deac70c827e463ecbfad879dfc24
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-07 15:28:30 +00:00
Tor Arne Vestbø
14218b880a macOS: Replace deprecated use of qSort with std::sort
Change-Id: Ic93f4ccb3ec2f09a4198ae9892923aae4ee00dc9
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-11-07 15:26:19 +00:00
Allan Sandfeld Jensen
6a02958f21 Fix narrowing warning on MSVC
Task-number: QTBUG-64307
Change-Id: I26032b71dc8fe316dddb8ce2adf6fd0a75ecf226
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-11-07 15:19:01 +00:00
Ulf Hermann
525f8516c2 Remove qml-debug configure flag and feature
The feature belongs to qtdeclarative and will be added there.

Change-Id: I2faf89f6caf841958e60efed8ff3882e530f0720
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-11-06 11:37:05 +00:00
Edward Welbourne
d46412665f Remove some unnecessary namespace prefixing
QWinTimeZonePrivate is based on QTimeZonePrivate, so can reference its
members without prefix.

Change-Id: I7b6bc33f70c4a497ec0caf897d48886a21f8fd65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-06 09:54:45 +00:00
Edward Welbourne
90a78c9724 Fix typo in tst_QTimeZone::testEpochTranPrivate()
The milli-seconds since epoch value for an invalid transition is,
of course, invalidMSecs(), not invalidSeconds().
Added a comment while I was at it, explaining why we expect a
transition before the epoch, if such transitions are supported.

Change-Id: I0f376f9d69c0e6e79a309dc011943baa41175135
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-06 09:54:20 +00:00
Liang Qi
8e860f836b Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2017-11-06 14:25:20 +00:00
Ulf Hermann
1a0b4b9f26 Modernize use of 'http' feature
Exclude QHttp(Multi)Part from being built if http is disabled, and
replace the exclusion macros. Use the qmake project files to exclude
source files, and QT_REQUIRE_CONFIG(http) in headers.

Change-Id: I432fa3c78aa97b5ed2eb1027ac1dc3bdb134f9ba
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-11-06 09:39:57 +00:00
Gatis Paeglis
ba3a26ea9f mouse handling: fix issue when mixing QTest::mouse* APIs
... that become apparent after switching qtestlib to use enhanced mouse
event (a37785ec76). With the old code path,
where QGuiApplication was deducing event type it would deduce mouse release
event even when there wasn't one. The new code path doesn't do that, which
revealed an obscure problem when mixing QTest::mouse* APIs (where QWindow
overload goes through QWindowSystemInterface API and QWidget overload goes
through QApplication::notify() and sets mouse_buttons from there). What
happened in this specific test case "./tst_qtreeview selection statusTip" was:

// tst_QTreeView::selection sets mouse_buttons = Qt::LeftButton from QApplication::notify
QTest::mousePress(widget, Qt::LeftButton, ..)

// tst_QTreeView::statusTip
QTest::mouseMove(window, )

The old code path sees that position and state has changed, creates a fake
mouse event, which gets deduced as mouse release even if there wasn't one.
And by luck this happened to set mouse_buttons=Qt::NoButton. So when we use
mouse_buttons later to create QMouseEvent everything works as expected. With
the enhanced mouse we don't clear the pressed button from mouse_buttons (set
in tst_QTreeView::selection) as this is done only from press/release events,
then pass it to QMouseEvent and later because of that QApplicationPrivate::
pickMouseReceiver() returns nullptr.

The fix here is to use e->buttons when constructing QMouseEvent, instead of
relying on mouse_buttons which gets changed from various places and has other
issues that can not be solved without invalidating the current documentation
of QGuiApplication::mouseButtons() (e.g QTBUG-33161). Tests and any Qt code
in general should avoid using the fragile QGuiApplication::mouseButtons() API.
This patch does not affect the old code path (it continues working as before)
and fixes the issue described above for the enhanced mouse API. The enhanced
mouse API actually is better in a way that it does not get affected by button
state from test functions that run earlier, as opposed to the old code path
where every subsequent test function uses mouse_buttons in whatever state it
was left by the test functions that run earlier.

Not relying on mouse_buttons when creating QMouseEvent helped also to discover
other logic error. This caused an in incorrect button state for a mouse move
event that is generated for a release event that simultaneously changes a mouse
position.

Task-number: QTBUG-64043
Change-Id: I6ad8e49d8437ab0858180c2d0d45694f3b3c2d60
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-11-05 17:36:08 +00:00
Thiago Macieira
ed48a03b21 QSysInfo: add a function that returns the boot ID
[ChangeLog][QtCore][QSysInfo] Added machineUniqueId() and
bootUniqueId().

Task-number: QTBUG-63425
Change-Id: I0b48fc8e90304e0dacc3fffd14e91064020d165b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-05 18:34:09 +00:00
Thiago Macieira
16fba4a28f QSysInfo: add a function that returns a somewhat permanent unique ID
We can use the D-Bus / systemd machine-id file (which is a UUID without
the dashes) on systems with D-Bus. On Windows, there's a value in the
registry that is filled when Windows is installed, like on Linux. For
BSD systems, the kernel has a UUID we can use too, so extract that.

Task-number: QTBUG-63425
Change-Id: I27eaacb532114dd188c4ffff13d32f2e3c1d74bb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-05 18:34:07 +00:00
Allan Sandfeld Jensen
dfbf5a7779 Cleanup of qcompositionfunctions
Remove long unused preload defines, make sign of alpha more consistent
and use the RGB64 define structure more.

This is preparing for trying to unify the declarations in case we need
a third form with floating points for HDR.

Change-Id: I47fc283aff1fe31a1eaba17e0413bc1e722f6a06
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-11-05 18:20:15 +00:00
Liang Qi
a7e4b645dc Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/corelib/global/minimum-linux.S
	src/network/access/qhttpthreaddelegate.cpp
	src/widgets/kernel/qwidgetwindow.cpp

Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
2017-11-05 18:02:18 +01:00
Jake Petroules
cd542a82b0 Remove references to obsolete platforms
ultrix and reliant have not seen a release since 1995. dgux not since
2001. bsdi not since 2003. irix not since 2006. osf not since 2010.
dynix... unclear, but no later than 2002. symbian needs no mention.
All considered obsolete, all gone.

sco and unixware are effectively obsolete. Remove them until someone
expresses a real need.

Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-05 06:33:53 +00:00
Ulf Hermann
5418c8764f QSemaphore: Fix futexMultiWaiterBit for 32bit systems
We don't actually need it in that case, but as the code that uses it is
disabled by a constant expression we cannot disable the variable itself
by a macro. The static_cast makes sure the compiler does not complain
about implicitly casting a 64bit value to a 32bit one.

 thread/qsemaphore.cpp:156:59: error: large integer implicitly truncated to unsigned type [-Werror=overflow]

Task-number: QTBUG-64261
Change-Id: I96f53e28b290e57033737b4f994f8af5b5666587
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-11-04 14:30:55 +00:00
Thiago Macieira
ea0e868c48 QFileSystemEngine: Fix renameat2() failures on non-local filesystems
The RENAME_NOREPLACE flag is supported for all Linux local filesystems,
since that can be easily checked by the VFS layer (it knows which files
exist and which ones don't). For non-local filesystems, the backend
needs support and that might need server-side support too. So we may get
EINVAL errors for those, in which case we fall back to link/unlink,
which in turn can fall back to rename().

EINVAL can also happen if we attempt to make a directory a
subdirectory of itself. In that case, we will attempt to link() it,
which will result in EPERM as we can't hardlink directories. Then we try
rename() again, which should result in the expected EINVAL.

Task-number: QTBUG-64008
Change-Id: Icaa86fc7b54d4b368c0efffd14f09ca23602dd2e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-29 21:21:06 +00:00
Frederik Gladhorn
365a41ce25 Accessibility docs: remove wrong statement
All accessible interfaces are stored in a cache, we never pass ownership
to callers.

Change-Id: I99f0e27baf111e4ca820c8f31875c0c55b4d6edb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-29 12:07:47 +00:00
Thiago Macieira
fb59760381 Fix GCC -Wfloat-conversion warnings (available since GCC 4.9)
This warning used to be part of -Wconversion, but that generates too
more noise than we're willing to fix now (like conversion from qint64 to
int). The float conversion does trigger for conversion from double to
float, as shown in all the QVectorND uses of float, but more
importantly, it triggers on passing floats to ints.

Change-Id: I69f37f9304f24709a823fffd14e69cfd33f75988
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-10-29 10:13:23 +00:00
Thiago Macieira
0e0f656f50 Mark the previously public qstringalgorithms.h functions private
Discussed during Qt Contributor Summit 2017. We concluded that we don't
want to make these functions public, as they do not follow Qt coding
style API. Specifically,

   qStartsWith(a, b)

is not easily understood which argument is the needle and which argument
is the haystack (same problem memcpy() has). Compare that to

   a.startsWith(b)

which can clearly be read in English as a subject-verb-object sentence.

This commit removes the unit tests that called compare().

Discussed-on: http://lists.qt-project.org/pipermail/development/2017-October/031060.html
Change-Id: Icaa86fc7b54d4b368c0efffd14ee6205eb9043fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-29 10:13:13 +00:00
Thiago Macieira
81f2516600 QRandomGenerator: add system() and global()
Right now,this does really nothing. This commit is just to allow us to
transition the other modules (besides qtbase) to use the syntax that
will become the API.

I've marked three places to use the system CSPRNG:
 1) the QHash seed
 2) QUuid
 3) QAuthenticator

I didn't think the HTTP multipart boundary needed to be
cryptographically safe, so I changed that one to the global generator.

Change-Id: Ib17dde1a1dbb49a7bba8fffd14ecf1938bd8ff61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-29 10:13:01 +00:00
Thiago Macieira
fd9dd8e95b Move the minimum Linux version declarations to a header
I'll need it in the AF_NETLINK implementation of QNetworkInterface.

Change-Id: Icaa86fc7b54d4b368c0efffd14ef5ce895d0ed5b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-28 06:08:59 +00:00
Thiago Macieira
1552bb6f31 Remove failing QVERIFY on bearer management
It fails for me on Windows 10. Therefore, this is wrong.

 FAIL!  : tst_QHostInfo::initTestCase() 'networkSession->waitForOpened(30000)' returned FALSE. ()
 S:\qt\qt5-msvc2017-x64\qtbase\tests\auto\network\kernel\qhostinfo\tst_qhostinfo.cpp(194) : failure location

Change-Id: Ib17dde1a1dbb49a7bba8fffd14ed5691472a4760
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-28 06:08:46 +00:00
Timur Pocheptsov
464b50b58d Fix -no-opengl build
A follow-up patch for 8e70241dcc:
Make 'shareContext' conditionally included/compiled
(protected by QT_CONFIG(opengl)).

Change-Id: Ieaeea6b146b47fba7a77e2576ae0a33042280199
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-10-28 06:07:38 +00:00
Gatis Paeglis
200c6dd896 qwidgetwindow: remove seemingly stray QApplicationPrivate::mouse_buttons
This patch removes mouse_buttons related code from qwidgetwindow.cpp
as it does not belong there for the following reasons:

- The commit (ed2a2dc6da) that added it in
Qt5 says that the logic was copied from qapplication_x11.cpp (filename
in Qt4 repository). Other qapplication_*.cpp platform implementations
did not have this kind of logic; thus having it in cross platform location
qwidgetwindow.cpp does not make sense.

- According to the documentation, QApplicationPrivate::mouse_buttons:

"Returns the current state of the buttons on the mouse. The current state
is updated synchronously as the event queue is emptied".

So the only place where changing this variable makes sense is in
QGuiApplicationPrivate::processMouseEvent, which is *when the event
queue is emptied*.

There are other places in source code where this variable is changed,
but all of those are hacks and should be cleaned out eventually:

// a hack due to insufficient QWindowSystemInterface API
plugins/platforms/windows/qwindowsdrag.cpp

// a hack to support code that bypasses QWSI API when sending mouse events
// via qApp->notify().
widgets/kernel/qapplication.cpp

- AFACT, the released button bit will be already unset by the time mouse
release event reaches QWidgetWindow::handleMouseEvent.

Change-Id: Ifb2b3b443ffff0274545e5d3c631cf1e77160502
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-27 20:48:33 +00:00
Friedemann Kleint
44401d26af uic: Fix clazy warnings clazy-qstring-left, clazy-unused-non-trivial-variable
Change-Id: Ibbb9a85dba7773bb70298906bc370b4e24d7d901
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-10-27 20:01:51 +00:00