Commit Graph

32720 Commits

Author SHA1 Message Date
Thiago Macieira
0c355e78f0 QRandomGenerator: add support for hardware-based random generators
This commit adds support for the x86 RDRAND instruction for
QRandomGenerator. This is the same that libstdc++-v3 uses for
std::random_device() by default. If it fails because the hardware does
not have enough entropy collected, we fall back to the operating system
generator, which often has more entropy collected from other sources.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5167214e1ea3f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:51 +00:00
Thiago Macieira
dfdc466dc1 Add proper detection of x86 RDRAND instruction
The instruction is "RDRAND", but the feature name, according to GCC, is
RDRND, so I had to change some macros in qsimd_p.h.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5166779137e63
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:48 +00:00
Thiago Macieira
f17095653e QUuid, QHttpMultipart and QHash: use QRandomGenerator
QRandomGenerator can produce more than 31 bits of data. And it uses
/dev/urandom for us on Unix, so QHash does not need to duplicate that
part.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b52a0d91f179eb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:46 +00:00
Thiago Macieira
5483b30868 QTemporaryFile: fix the generation of names from templates
First and most importantly, let's not use more than half of the template
for the application's PID. With over 71% of all PIDs on a typical Linux
system and 90% of those on a Darwin system having 5 decimal digits,
using them all in a template that is usually 6 characters long is
wasteful. That leaves only 1 character for the random part, thereby
reducing the number of temporary files possible to only 52. So limit the
PID to half the characters of the template.

Second, let's use QRandomGenerator::bounded to create the the random
part, instead of qrand (which is often unseeded at this point).

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b52eda5e467395
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:43 +00:00
Thiago Macieira
7697227781 Use QtPrivate::FunctionPointer to get the type of srand's first arg
Avoids #ifdefs and guesswork.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5210efaea7d00
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:40 +00:00
Thiago Macieira
030782e1a8 Move qrand() & qsrand() to qrandom.cpp
Now that we have the file, may as well consolidate

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b51d3e701c6a94
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:37 +00:00
Thiago Macieira
593f022515 Long live QRandomGenerator
This class provides a reasonably-secure random number generator that
does not need seeding. That is quite unlike qrand(), which requires a
seed and is low-quality (definitely not secure).

This class is also like std::random_device, but better. It provides an
operator() like std::random_device, but unlike that, it also provides a
way to fill a buffer with random data, not just one 32-bit quantity.
It's also stateless.

Finally, it also implements std::seed_seq-like generate(). It obeys the
standard requirement of the range (32-bit) but not that of the algorithm
(if you wanted that, you'd use std::seed_seq itself). Instead,
generate() fills with pure random data.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b4e3ba9ea04da8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:34 +00:00
Edward Welbourne
267edbec19 Clean up in CLDR scripts for QLocale
Use python more fluently; DRY - use functions to avoid repetition; use
dict-comprehensions; use os.path.join() in preference to arithmetic
with path strings; use elsif to avoid the need for a local variable;
set() can take a generator directly, no need to go via a list; don't
end lines in semicolon (this is python).  Test isdir() once instead of
exists() twice on the same name.

Just, generally, use python's feature-set.

Change-Id: Ib114aa016f70b3be09e968d9cfc069b057f49d41
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:55 +00:00
Edward Welbourne
6a4875f0d1 Replace three functions with one simpler function
load{Language,Script,Country}Map() were all structurally very similar,
so replace them with a single loadMap() that takes a second argument
to say *which* map to load.  At the same time, use a dict
comprehension to simplify constructing the result.

Change-Id: Ie43a71156010277200543a8937056efd35251955
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:40 +00:00
Edward Welbourne
e93af7dafd Turn a next-node function into an iterator over nodes
This simplifies a duplicated iteration pattern in the calling code.
It also frees the first-node function to raise an Error (which the
iterator now catches) if it finds no node, where it used to return
False (instead of a node, so other code using it would raise confusing
errors from trying to use False as a node, where now it'll get a clear
Error about a missing node).  There were also no callers passing an
empty name, so the test for matching nodes (here moved to its own
short function) didn't need to handle that as a special case.

Change-Id: Ife6cad8943cf5dc2c6ed68429d4a217cb9bea446
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:33 +00:00
Edward Welbourne
ad1cec5a5e Simplify cldr2qlocalexml.integrateWeekData()
It had a separate variable for each of three lists for each day of the
week; and used each list only once.  Iterate the days of the week for
each lookup, discarding it once used.

Change-Id: I32c8bd5bfcbb99f0a8697d374e63112761f18dbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:22 +00:00
Edward Welbourne
03a1675eac Reduce code duplication in writing of string data for locales
Each StringData object got its own block, of common form, to output
its C array; give each object a name so that we can automate this as
an iteration over StringData objects.  One (endonyms_data) gains a
blank line that the others all had but it lacked.

Change-Id: I96c014728a58343c82304c5117b474fee980d9c7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:15 +00:00
Edward Welbourne
ebb0212133 Rework locale serialization and parsing with less repetition
... because copy-and-paste is worth discouraging.  Moved code that
writes and digests our Q Local XML form of the data into a common
class, localexml.Locale, for use by the scripts that write and read
it.  Hopefully, it'll be easier to keep what's written and read in
sync hereafter.

Inlined some trivial functions in the process; and only create a
day-number mapping dictionary once, instead of once per use.  Also
made it easier to see which attributes get which special handling (and
documented this); and revised an assertion to be more helpful.

Change-Id: I711b6a193a4ad94b5ff714c025f2732cd1a965a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:08 +00:00
Edward Welbourne
3a569573b2 Clean up the output code for the big table of CLDR data
Include headers for all fields (several were missing).
Make field widths explicit to headers can line up with content.
Use the same format for the (common part of the) all-zeros line.
Document and lay-out headers and format string, to make them easier to
keep in sync.  Make a pair of comments clearer.

Re-ran the script to regenerate the table: the result is best viewed
with git show -w, to ignore the spacing changes (or git show -b to
notice only the one harmless discrepancy exposed in old all-zeros
data).  Aside from spacing, locale_data[] has gained some missing
columns in its header comment, which now lines headings up properly
above actual data.

Change-Id: I44242f38391353f2ec8e144cb7e8b54b0a359341
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-06-08 13:37:38 +00:00
Edward Welbourne
9df60df12a Made the "do not edit generated code" notice clearer
Say where to find the scripts and make clear what to update to get
changes.

Change-Id: I424b7fdf846f7141c6df81eef90eb1ca0378bcf8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:37:21 +00:00
Edward Welbourne
2c04d1dab5 Give reasons when skipping files
Change-Id: I397d17ad252363dd0d7d9b4f53b7d105075da306
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:37:14 +00:00
Edward Welbourne
08cfd02312 Use python more competently in CLDR/qLocaleXML scripts
Make the python2 dependency explicit (sooner or later, python3 shall
be the default /bin/env python), make time-zone script executable (it
had a shebang).  Use triple-quoted strings, or single quotes, to avoid
extra backslashes, remove some simply spurious backslashes.  Use
generators rather than map or filter with lambdas and iterate rather
than duplicating code.  Clarify some comments.

Regenerated headers: this upates the date of generation, cuts back a
double-blank-line to single and skips a spurious trailing
comma-newline on an array's data.

Change-Id: I54439f0dec132865991fe5147d509cea0f9419a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:37:06 +00:00
Edward Welbourne
72900b3d88 Fix CLDR C++ generation to name "Han with Bopomofo" properly
We were using "Han With Bopomofo" (capitalized With) so that an enum
member in qlocale.h would be suitably camel-case; however, this lead
to spurious changes in qlocale_data_p.h where it names the script.
Use the correct (lower-case with) form and arrange for the enum
members to be generated with first letter of each word upper-case (but
not with each word capitalize()d; some words in there are already
camel-case, so .capitalize()ing would lower-case the later sub-words
in these).

Change-Id: I974c89dd40814eaf3bd538f06b9b4ebf17492f20
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:37:01 +00:00
Edward Welbourne
99dd95f3c2 Document how to use the CLDR-related scripts
Say where to find the data, how to unpack it and how to run the
scripts to update our source tree from it.

Change-Id: I5b680090bb5850f29c1e7d61efd1d450856b9949
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:36:48 +00:00
Edward Welbourne
0caaf33d2f Document the ci key in the BLACKLIST file format
Rearranged existing top-level example to let the ci example make some
kind of sense.

Change-Id: I0a5dd6270aef419c8a33d390c801460f23e10667
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-06-08 13:36:25 +00:00
Edward Welbourne
3e0bf04d7b Typo-fix: s/looses/loses/g
When an archer lets go of the bow-string, she looses an arrow; when
the hounds are straining at their leashes and the handler lets go, he
looses the dogs.  It's archaic usage now; we'd normally say "lets
loose", "lets go" or "releases".  In any case what was meant here was
that something got lost; a widget loses focus or a network loses its
connection.

Change-Id: Ic1fbe9e1f76185bcb7caf034d6be97ebfeb2e270
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-06-08 13:36:18 +00:00
Edward Welbourne
d3e73b4f6b Fix typo in QMutex's free-list's Sizes[3]
A QFreeList's MaxIndex is clearly meant to be the sum of its Sizes;
but the parentheses in MaxIndex - (16 - 128 - 1024) doesn't give the
same as without the parentheses.  Noticed while reviewing a copy of
this code now used by QReadWriteLock (which has this fix).

Change-Id: I9f68171475b3c6edc18896056b5532183fee92b2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-08 13:36:00 +00:00
Laszlo Agocs
2ea90c56f2 Start supporting purely offscreen QOpenGLWidget
Due to popular demand. It does have it benefits (especially when
it comes to convenience) to allow grabbing QOpenGLWidgets even
when they are not part of an actual window and are not actually
visible.

Does not involve much more than dropping the warnings and bailouts
when there is active native window (because the QOpenGLWidget/its
parents are still hidden).

In addition the device pixel ratio from metric() has to be fixed
as well.

[ChangeLog][Qt Widgets] QOpenGLWidget is now able to render and
return its content via grabFramebuffer(), QWidget::grab() or
QWidget::render() even when the widget has not been made visible.

Task-number: QTBUG-47185
Task-number: QTBUG-61280
Change-Id: Icc2b0b3ce9778a3eb6409d54744238568abb0f0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-06-08 13:34:54 +00:00
Gatis Paeglis
41ae544c40 xcb,evdevmouse: don't use qpa compatibility functions
Change-Id: If3f474dcb6ee117c6dd26cd56fd4ad8d39e60e1f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-06-08 12:40:46 +00:00
Tor Arne Vestbø
c3a115b90d json: Add operator[] to QJsonDocument for implicit object and array access
Makes it easier to pull out data from a document when the structure is
known up front, while still supporting default values if the structure
does not match the expectation, eg:

 int age = QJsonDocument::fromJson(ba)["users"][0]["age"].toInt(-1);

Change-Id: Ief0899bbb81610f6f22a56e2ac846121bffe77a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 11:23:55 +00:00
Tor Arne Vestbø
a7823b4878 json: Add operator[] to QJsonValue for implicit object and array access
Saves a lot of manual toArray() and toObject() calls when the
JSON structure is usually known anyways. Read only access for now.

Change-Id: I5fd787144198e0443e4da285a11ce2597b66f99f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 11:23:46 +00:00
Marc Mutz
2db0531a57 QKeySequence: remove a clause guarding an impossible condition
All code paths leading up to this line unconditionally dereference the pointer,
so it cannot be nullptr.

Remove the check. It only confuses readers of the code and probably will trigger
warnings with tomorrow's compilers.

Change-Id: I31a643738e951da9c04f0091645016276b047761
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-08 09:36:34 +00:00
Albert Astals Cid
f78a189da5 QSSLSocket::readData return -1 when socket is not connected
As QAbstractSocket::readData does and as the documentation of QIODevice says
"this function returns -1 in those cases (that is, reading on a closed
socket..."

Change-Id: I1e64673f6a6d792a640bd6cb28b2bb5a0f18dc36
Reviewed-by: Aleix Pol
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-08 04:00:54 +00:00
Liang Qi
678ff94ff2 Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-06-07 20:45:28 +00:00
Liang Qi
7cbee56296 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/widgets/widgets/qmenu.cpp

Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
2017-06-07 14:02:43 +02:00
Allan Sandfeld Jensen
0169edf6fd Implement remaining porter-duff compositions for rgb64
Gets rid of debug output when they are used, which is more common now
that we use it for unpremultiplied ARGB32.

Task-number: QTBUG-60549
Change-Id: I14b2eb34d1d08612916e2b69b188f33dbe1b525c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-07 11:29:54 +00:00
Jesus Fernandez
e400b7e326 Ensure QDBusConnectionPrivate pointer initialization
Change-Id: Id7ca5b412462b5d7a18d12f9a227fdf9ef7b2344
Coverity-Id: 180869
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-06 20:26:23 +00:00
Jesus Fernandez
5b24f0a6bb Add QLocalServer::socketDescriptor
Adds a function to return the native socket descriptor. It allows
threaded or forked applications to reuse a previously created socket.

[ChangeLog][QtNetwork][QLocalServer] Added a function to retrieve
the socket descriptor.

Task-number: QTBUG-55043
Change-Id: I556e97000d2c02ad2bdd636984de6c7564381c6a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-06 17:46:50 +00:00
Jesus Fernandez
3a072f354f More info in QLocalSocket::socketDescriptor
Documents the returned type of values depending on the platform.

Change-Id: I0659ae8a0a4c5aafd368a25564eca29973702b1e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-06 17:46:39 +00:00
Oliver Wolff
5f0ce2333f Remove -permissive- flag from MSVC 2017 build
The flag makes the build fail for UWP as well as desktop Windows . It
will trigger a compile error as soon as UWP API is used, which happens
in qtbase for desktop in the direct2d backend, but it is also used for
other Qt modules, so we decided to disable the flag for now.

This patch partly reverts b7d76e533c

Task-number: QTBUG-61239
Change-Id: I0cc630f4c09c52f0c116f4a7b95a44c3a55e0be3
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-06 14:05:44 +00:00
Marc Mutz
1e8e79d71e QScopedArrayPointer: document the most important ctor
The ctor that everyone would want to use was marked as \internal,
probably because of the SFINAE expression appearing in its signature.

Move the SFINAE to the template argument list, which QDoc hides from
the user, and drop the \internal. While at it, drop the home-grown
std::is_same re-implementation and use the real deal.

Change-Id: Ia357fe65f94e10ac9eeccb3490aa8b3e68114cbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-06 07:30:30 +00:00
Jani Heikkinen
934235e967 Revert "moc: remove _MSC_EXTENSIONS #define"
It seems this change is preventing us to integrate qt5.git in '5.9'

This reverts commit c3030d7163.

Task-number: QTBUG-61204
Change-Id: Id98afaa23be0a8dd6f2c54a899f46542c65436aa
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-05 09:00:54 +00:00
Thiago Macieira
d56c6cf7a4 Work around uname(2) on Apple mobile OSes not returning the proper arch
Task-number: QTBUG-61205
Change-Id: Ia3e896da908f42939148fffd14c46fc991650f6f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-06-05 06:33:52 +00:00
Elvis Angelaccio
04eba7b538 QStyle: deprecate SH_Widget_Animate in favor of SH_Widget_Animation_Duration
This change introduces a new SH_Widget_Animation_Duration style hint
that applications can query instead of manually hardcoding the duration
of an animation.

As default value we use 200, which is the value that was already used in
QWidgetAnimator. A value equal to 0 means that the animations will be
disabled. This also implies that the SH_Widget_Animate style hint is
superseded and can be deprecated.

The new style hint is configurable with style sheets.

[ChangeLog][QtWidgets][Styles] Added SH_Widget_Animation_Duration style
hint which deprecates SH_Widget_Animate.

Change-Id: Ic3f5e4f7145a89697f28666aeaecabb1f3c5c96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-04 12:30:08 +00:00
Sérgio Martins
acaaa84d7e Fix build with clang 4.0 and libstdc++ 7.1.1
With this setup clang cannot use c++1z yet.
Fixed with clang 5.0.

In file included from /data/sources/qt/qt5/qtbase/src/corelib/codecs/qtextcodec.cpp:53:
In file included from ../../../include/QtCore/5.9.1/QtCore/private/qcoreglobaldata_p.h:1:
In file included from ../../../include/QtCore/5.9.1/QtCore/private/../../../../../../../../../sources/qt/qt5/qtbase/src/corelib/kernel/qcoreglobaldata_p.h:55:
In file included from ../../../include/QtCore/qmap.h:1:
In file included from ../../../include/QtCore/../../../../../../sources/qt/qt5/qtbase/src/corelib/tools/qmap.h:52:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/map:60:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/bits/stl_tree.h:72:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/bits/node_handle.h:39:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:27: error: use of class template 'optional' requires template arguments

Change-Id: Ib4cd8a9f5791a6e6cae4e6d61dfec3ad50dd63ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-03 18:10:31 +00:00
R.J.V. Bertin
6e97d091e4 define QT_NO_EXCEPTIONS reliably when using Clang
Clang's definition of the __EXCEPTIONS macro is inconsistent across
platforms. When compiling for Darwin, Clang 3.6 and newer will set the
token when exceptions are enabled in either C++ or ObjC. This change
adds the reliable check described in the Clang 3.6 release notes to
ensure that QT_NO_EXCEPTIONS is defined when required.
The check requires the use of the Clang-specific __has_feature()
syntax for which a new proxy macro QT_HAS_FEATURE(x) is added in
qcompilerdetection.h

Task-number: QTBUG-61034
Change-Id: Ie7b482dfa1a4a5b700a6b97562c26b626be1fc04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-03 07:22:06 +00:00
Thiago Macieira
b7d76e533c MSVC: Enable standard-conformance mode by default
That's not the same as -Za.

Change-Id: Ica9894dc9b5e48278fd4fffd14bb316b687abffe
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-03 03:35:57 +00:00
Thiago Macieira
e4eaa62943 Disable bogus GCC 7 warning about string op overflow
Analysis proves this is a false positive:

 qarraydataops.h:69:17: error: ‘void* memset(void*, int, size_t)’: specified size between 18446744056529682436 and
 18446744065119617024 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]

Change-Id: I7814054a102a407d876ffffd14b6ab0be9e222fc
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-03 03:35:54 +00:00
Shawn Rutledge
4480f47f7b tablet example: don't update the cursor image on iOS
There is no visible cursor on iOS, so updating the image is a waste
of time.  Removing this does in fact speed up rendering of the strokes.

Change-Id: If958fabeefd4273644707277d4a084855d415bb1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-06-02 20:31:16 +00:00
Shawn Rutledge
c379719607 QTesselator: disable for-loop analysis on Clang
Caught by Clang 4:
error: variable 'k' is incremented both in the loop header and in the loop body [-Werror,-Wfor-loop-analysis]

But we don't want to change behavior unless we can prove that it's wrong
or that there's a way to refactor this without changing it.

Change-Id: Iecee112b0cd96bec8d975430a74ca548ee2f470f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-02 20:31:03 +00:00
Gatis Paeglis
ab8ea993b3 qpa: start using QT_DEPRECATED_SINCE to increase visibility
... when platform plugins are using compatibility APIs.

Even though QPA is not a public API and does not promise source/binary
compatibility, we still try to not break things when possible. Eventually
deprectated APIs will be dropped  (e.g between major Qt versions). Having
deprecation warnings here would help maintainers to notice API changes even
before their code stops compiling due to removed QPA APIs. This will also
ensure that we won't forget to remove compatibility APIs.

Change-Id: If13786eb7d42a595708ace00b2ddea5209df18db
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-06-02 20:19:08 +00:00
Joerg Bornemann
ea57a23d7a Remove QWinOverlappedIoNotifier
This class in unused in qtbase since Qt 5.6.1.

The only outside usage was in qtserialport, which got its own copy of
QWinOverlappedIoNotifier in commit qtserialport/65dba188.

Change-Id: I7668e67a1cc49c4418c66141784b180cd5f9d479
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-06-02 20:01:43 +00:00
Marc Mutz
1e503d7634 Move QGestureRecognizer test to widgets/kernel
It's the subdir where the implementation also lives. There's no
src/widgets/gestures, either.

Change the mac: into a darwin: scope in the .pro file, so Sanity Bot
does not complain.

Change-Id: I7608d6da05af4a1117db585798a87a20ae80717a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-02 18:36:11 +00:00
Friedemann Kleint
b04b4ae4f6 QWindowsXPStyle: Do not draw some opaque theme parts directly
Drawing directly using GDI32 can produce colors that are invalid in the
premultiplied alpha format which is used for the backing store. Exclude part
ids which are known to be opaque.

Task-number: QTBUG-60571
Change-Id: I0863d030acf79f317f5e82a5ee954c9cb507c449
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-06-02 14:04:58 +00:00
Timur Pocheptsov
4fb1745639 Ssl socket - fix broken certificate verification
On iOS QSslConfiguration always has an empty list of system CA certificates.
Calling SecTrustSetAnchorCertificatesOnly(.., TRUE) on iOS  results in
SecTrustEvaluate failing to verify a valid certificate, since there
are no 'anchors' at all. We can use SecTrustSetAnchorCerificatesOnly(.. TRUE)
on macOS only, where we do extract/copy system certificates using
SecTrustSettingsCopyCertificates and save them in a QSslConfiguration's
list.

Task-number: QTBUG-61053
Change-Id: I70d4e46273d78414baaac8531273def707c3eebc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-06-02 12:34:22 +00:00