Commit Graph

30827 Commits

Author SHA1 Message Date
Alexander Volkov
b57e7c0963 doc: Replace Q_DECL_OVERRIDE by override in snippets
And remove redundant virtual.

Change-Id: If0650409b88ad962f6713d082d9095675f4c68e8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-12-14 16:49:23 +00:00
Edward Welbourne
f8ec940ab6 Simplify QDateTime::toString(Qt::TextDate)'s text construction
We can in fact delegate to QDate::toString(), contrary to the comment
that was there; we just need to insert the time in the right place,
which is easy enough to find.

Change-Id: I66624724628d45ce283243879b102ec8f741a15f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 16:41:06 +00:00
Edward Welbourne
ff4f0c3276 Fix handling of time-zones in QDateTime::toString(Qt::TextDate)
Previously, a zone-based time would claim to be GMT, rather than
identifying its zone properly.  Sadly, testing this reveals that
proprietary operating systems don't handle abbreviations ideally.

Task-number: QTBUG-57320
Task-number: QTBUG-57298
Change-Id: I8d8b7fffdbf65ac6178a65f5fc2df4d25afb1a14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 16:40:57 +00:00
Edward Welbourne
7c33c644d3 Fix QDateTime::toString(Qt::ISODate)'s handling of Qt::TimeZone
When the time is specified relative to a zone, the ISO date produced
lacked its offset suffix; all zones were treated as if they were local
time.  Handle zone as for an offset from UTC and ensure we do set the
date-time objects's offset from UTC when it's zone-based.

Change-Id: I7c9896bb8ec0a9d89df14a6e94b005174ab9e943
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 16:40:42 +00:00
Andy Nichols
9d8db91ada Android: Enable Adoption of ANativeWindow handle as a QOffscreenSurface
This is done by adding an API to QOffscreenSurface to enable setting a
native handle which can represent a native offscreen surface.  When
using the TexureView it is necessary to render to SurfaceTexture objects
which are exposed as offscreen window surfaces.  After wraping a
SurfaceTexture in a android.view.Surface object and passing it to C++
via the JNI, it is possible to get the needed ANativeWindow* handle
required to pass to eglCreateWindowSurface. So by setting this native
handle Qt can then render to this "native" offscreen surface.

Change-Id: If7fc5ac7ac588fe6c3a6fb883ea7e439d095470f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-12-14 15:51:23 +00:00
Christian Strømme
87e553b58a Android: Fix the bearer management plugin when running as a service
Since Qt for Android now supports running as a service, we shouldn't
use the activity context unconditionally, but instead query the current
context from QtAndroidPrivate::context().

Change-Id: Ib793ba890fdbfc0cfe7b20115e41ff64cc73477a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-12-14 15:08:11 +00:00
Allan Sandfeld Jensen
b750a3786f Lower timeout on tst_QSemaphore::tryAcquireWithTimeout
The test was so slow it was blacklisted on all platforms for timing out.
This patch lowers the timeout to a 5th and tries removing the blacklist.

Change-Id: Ib28b21de572517c548a14300f26815598efe91e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 14:39:58 +00:00
Ulf Hermann
1f665efa91 Q_CHECK_PTR the result of QDataBuffer's allocations
We might run out of memory or malloc() or realloc() might fail for any
other reason. We want to crash cleanly with a clear message in that
case, rather than returning a null pointer.

Change-Id: If09c1b9e905fc60a5d9d45e598a418df433cf83b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 14:33:11 +00:00
BogDan Vatra
b8fab7c9f5 Add Q_[ENUM|FLAG]_NS to global qt-cpp-defines doc conf
We need to add Q_[ENUM|FLAG]_NS to global qt-cpp-defines doc conf otherwise
qdoc ignores them and it will not produce any documentation or links to
these enums/flags

Task-number: QTBUG-57616
Change-Id: I744317346feb41db02787677f8698c4de15db226
Reviewed-by: Martin Smith <martin.smith@qt.io>
2016-12-14 14:16:46 +00:00
Thiago Macieira
5556308cbf MySQL: Make sure we clean the libraries from mysql_config
It prints libraries necessary for linking against the MySQL static
library. When linking against dynamic libraries, we end up with too many
parameters. We don't want to explicitly link our plugin to OpenSSL and
this is especially important on macOS since Sierra no longer comes with
OpenSSL development files.

On my Linux:
  -L/usr/lib64 -lmysqlclient -lpthread -lz -lm -lssl -lcrypto -ldl

On my macOS:
  -L/usr/local/Cellar/mysql/5.7.16/lib -lmysqlclient -lssl -lcrypto

Instead, keep only -L options (that haven't been removed by the function
$$filterLibraryPath above) and the actual client library.

Change-Id: I3e3f0326f7234a26acf5fffd148fa985d0fd9c93
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-12-14 13:29:57 +00:00
Friedemann Kleint
1d68e3386d eglfs/deviceintegration: Ensure eglfs_kms_support is added only once
Use qmake operator *= to prevent adding it multiple times resulting
in warnings on Linux/Desktop:

Makefile:114: warning: overriding recipe for target 'sub-eglfs_kms_support-qmake_all'
Makefile:64: warning: ignoring old recipe for target 'sub-eglfs_kms_support-qmake_all'
Makefile:118: warning: overriding recipe for target 'sub-eglfs_kms_support'
...

Change-Id: I18a926c9faeb8f9eafea5223d32c526c06c43724
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-12-14 13:06:41 +00:00
Erik Verbruggen
311e523cef Aarch64: vectorize findChar
The "algorithm" is the same as the one for x86.

Also added a comment to qt_from_latin1 to indicate that manual
vectorization doesn't bring anything useful.

Change-Id: I6130cbd83c14c22b1bd15d726b26dbc83068b1a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 09:34:25 +00:00
Venugopal Shivashankar
9cc3c8983e Doc: Update the highlighted examples list
Removed a few from the list after testing them on a
Linux desktop and an Android device.

Change-Id: If1b9e7739d8c374acc8cbd2c72d7176fdff2e9f3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-12-14 07:20:12 +00:00
Thiago Macieira
f92cfab225 Silence warning about non-void function without return value
Q_UNREACHABLE() isn't enough for some compilers, especially if it
expands to nothing.

warning #1011: missing return statement at end of non-void function "fetchPixel<bpp>(const uchar={unsigned char} *, int) [with bpp=QPixelLayout::BPPNone]"

Change-Id: I3e3f0326f7234a26acf5fffd148fecf0b72ea7e0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-12-14 04:57:40 +00:00
Gabriel de Dietrich
59b80d606e Windows Font DB: Add missing library
This solves link errors with font support in the minimal QPA plugin.

This is similar to 449204f8c0 in the Cocoa font DB.

Change-Id: Ia0268b5c4d3c69125c909e458d15ea5224d2630a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-12-13 20:37:20 +00:00
Oswald Buddenhagen
ab0cc3055d move all target spec handling to qmake-based configure system
we pull this feat off by booting configure with a dummy spec. the proper
spec gets loaded subsequently.

note that it was necessary to move the cache loading after processing
the early checks (from which the spec handling is triggered). this is
just fine, as the cache is needed only by tests, which are forbidden at
this stage by definition.

Change-Id: I5120e25a8bf05fb8cc5485fd93cf6387301089aa
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-13 18:56:34 +00:00
Oswald Buddenhagen
8861b82f9e move qdevice.pri creation to qmake-based configure system
Change-Id: I06540c3b6d98303bd9a218feedfb529993477ed6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-13 18:56:28 +00:00
Oswald Buddenhagen
b6b44b368c qmake: introduce magic bypassNesting() scope
will be needed by configure.

Change-Id: If14e6944fe84767bd67604ecde98076f873749ef
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:56:20 +00:00
Oswald Buddenhagen
169a40d511 move generation of qconfig.cpp (and qt.conf) to qmake-based configure
this moves us another step towards the "outer" configure doing just
minimal bootstrapping of qmake.

a challenge here was that so far, qmake itself needed qconfig.cpp. this
was replaced by usage of a qt.conf file instead of compiled-in values.
however, to make the executable still self-contained, that qt.conf is
embedded into it (by simple appending of a fixed signature and the text
file).

the qmake with the embedded qt.conf is not used for the qt build itself,
which instead relies on the qt.conf in bin/ as before. however, due to
the missing built-in values, this file now needs to contain more
information than before. but except for a minimal version that is needed
to start up qmake/configure at all, that file is now also generated with
qmake. as some of the newly set up properties are subsequently used by
configure itself, qmake gains a (deliberately undocumented) function to
reload the qt.conf after it's fully populated.

unlike the old implementations, this one doesn't emit redundant qt.conf
entries which match the hard-coded fallbacks. omitting them leads to
leaner files which are more comprehensible.

Started-by: Paolo Angelelli <paolo.angelelli@qt.io>
Change-Id: I4526ef64b3c89d9851e10f83965fe479ed7f39f6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-13 18:56:12 +00:00
Oswald Buddenhagen
42196f4061 nuke configure -host-option
in its current form, it was introduced only in 5.7, mostly as a side
effect of -external-hostbindir (which is now handled differently).
it only ever worked for the macOS and MinGW specs, as a side effect of
them supporting -sdk and -device-option (for good reasons), and was
supported only by the unix configure. it's not believed to be really
useful and complicates matters somewhat, so get rid of it again.

should it ever become actually relevant, it can be re-introduced
properly, probably along with a -host-sdk option for macOS.

Change-Id: Ib078469ea39deb821c7b6a8c67fda9e1a95fedf5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:59 +00:00
Oswald Buddenhagen
e58eb3d6f9 move device spec validation to configure
instead of letting the specs validate themselves on each call, let them
only define a callback for use by the verifyspec configure test. this
is somewhat faster, and allows them to be loaded before qdevice.pri is
populated.

Change-Id: I2b60d006b33bbf42c28949f10ad429520ed32f46
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:52 +00:00
Oswald Buddenhagen
e2eab15e34 write HOST_QT_TOOLS to qmodule.pri instead of qhost.pri
its only consumer is qt_tool.prf, which is an internal api.

Change-Id: Iae90b079c5af60efad2ded70d6ea481212e5353a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:48 +00:00
Oswald Buddenhagen
1510c19aff don't scope QMAKE_MAC_SDK assignment in qdevice.pri any more
host builds are using qhost.pri since c23a086e4.

Change-Id: I312a7fdbdf8a392d74905d52d02bcb77459063cc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:43 +00:00
Oswald Buddenhagen
d004e086a2 move definition of configure -continue switch to builtins
... where it actually belongs, as it should work in each repo in a
modular build.

Change-Id: I5463f0bcacb239900bed0b0f7be9cf32a3eab04e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:37 +00:00
Oswald Buddenhagen
8ebc7e967c move configure -redo handling (mostly) to qmake-based system
the qmake bootstrap uses some of the options, so the configures still
read config.opt for their own purposes, but the general handling is
entirely in the new system now.

Change-Id: I2c6c657d4da01c8d520ac74795454747bb224bdd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:32 +00:00
Oswald Buddenhagen
24cb1580e2 make handling of built-in configure options data-driven
Change-Id: I08b226b6c9255b60393734e8ffcb745ccb63c597
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:28 +00:00
Oswald Buddenhagen
2dcc1a8e46 move preparation of configure test build dir to qmake-based system
Change-Id: I650fb92cfa858bf6d7ff5756aa0efe182f036a55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:25 +00:00
Oswald Buddenhagen
80e63223f8 make qmake abort when $$prompt() gets EOF
otherwise, infinite loops can result, as amply demonstrated by the new
configure (which duly replicated the old configures' behavior ...).

QMakeEvaluator::evaluateBuiltinExpand() now returns a VisitReturn like
all other evaluate*() functions. the string list return value is now an
out parameter; i used a reference instead of a pointer to avoid
adjusting 56 usages of it.

Task-number: QTBUG-13964
Change-Id: I51ca7df8d694c6ffe9d9899cba414b1b46f5ce95
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-13 18:55:19 +00:00
Edward Welbourne
5b1f18b0f1 Fix typo in autogenerated *.pro file comment
The phrase "which as been" lacked an h (albeit one silent in some
anglic dialects).  The added letter made an already long line stick
out just a little more.  Judicious rephrasing of the early part of its
sentence made reflow a way to fix that.

Change-Id: I29c2ac79d08a135dd4a16518f459872c8ecd1f24
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-12-13 15:05:22 +00:00
Paul Olav Tvete
c0842aceaf Make size grip work with high dpi scaling
Task-number: QTBUG-53389
Change-Id: I6e922f0555ae296f3152d4df2598534fa73fb584
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-12-13 14:48:30 +00:00
Gunnar Sletta
e63f861e52 Add support for filtering in the qevdevtouch plugin
This patch adds a Kalman filter to the evdev touch plugin
which samples velocity and position in x and y direction
and uses this to emit touch points in sync with the application's
repaint rate. The filter also allows for basic prediction
based on current position and velocity estimates.

Filtering is opt-in, and can be enabled by passing for instance
 > app -plugin evdevtouch:/dev/touchscreen:filtered:prediction=16

The logic relies on a stable QWindow::requestUpdate() and will work
best in combination with QtQuick and blocking swap buffers (or
equivalent). QScreen::refreshRate() will also have to be reasonably
accurate.

[ChangeLog][Platform Specific Changes] The evdevtouch plugin now
has the option to apply filtering and prediction. Enabled by
passing "filtered" as an argument. Prediction can be specified
by passing "prediction=X" as an argument, where X is in
milliseconds.

Change-Id: I682db4386fe3a7cef8b4a08ea0d16c1491efb873
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-12-13 13:59:46 +00:00
Liang Qi
6755ec891a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	configure
	qmake/Makefile.unix.macos
	qmake/Makefile.unix.win32
	qmake/generators/win32/msvc_vcproj.cpp
	src/3rdparty/pcre/qt_attribution.json
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qdeadlinetimer.cpp
	src/platformsupport/kmsconvenience/qkmsdevice.cpp
	src/platformsupport/kmsconvenience/qkmsdevice_p.h
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
	tests/manual/qstorageinfo/printvolumes.cpp
	tools/configure/configureapp.cpp

Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
2016-12-13 09:39:20 +01:00
BogDan Vatra
36e4b13e29 Android: fix (partially) text deletion when the cursor is moved
- wait until the handle location changes the cursor position
- don't update cursor position if:
 * a batchEdit is in progress
 * the UpdateSelection is blocked
- finish the composing before update the cursor
- add the missing .java files

There are still corner situations when the text gets deleted/moved, but
those are pretty rare and they will be fix in another patch.

Task-number: QTBUG-57507
Change-Id: I230d7f64625fb556e1be3069694a71e9bc91323a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2016-12-13 05:14:40 +00:00
Allan Sandfeld Jensen
bb0f29f82b Fix gcc 6.4 builds
The builtins clzs and ctzs have been removed. Additionally they were
never proper internal GCC builtins and shouldn't have been used in a
constexpr function in the first place. This patch removes the assumption
that they exist when BMI is available, and let GCC fall back to using
__builtin_clz and __builtin_ctz.

Change-Id: I3e0b4e246098bb9ce6ede28b311948260ef881b9
Task-number: QTBUG-56813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-13 05:14:32 +00:00
Lambert Duijst
00c9ec63a5 Fix for horizontal scrollbars
Horizontal scrollbars scroll in the wrong direction when the app
has a stylesheet and the LayoutDirection is RightToLeft.

Change-Id: I860cb733709e8d59a7b844f2b6ed1ee63410956e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-12-13 00:42:09 +00:00
Gabriel de Dietrich
449204f8c0 CoreText Font DB: Link to AppKit instead of ApplicationServices
This solves link errors with font support in the minimal QPA plugin.

Change-Id: Id05128e1d752b974621d7035f1e886e75aa004f0
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-12 19:59:33 +00:00
Giuseppe D'Angelo
9ff34b3a08 PCRE2: remove PCRE1 code
Change-Id: I83cf7c22fe95fb6384b751d09867633a72f093db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 19:13:47 +00:00
Giuseppe D'Angelo
9ca635482d PCRE2: port QRegularExpression to PCRE2
PCRE1 is going towards EOL. PCRE2 is the way forward in terms
of new features, performance, and security improvements. The
APIs that QRegularExpression uses are similar so the required
modifications aren't extensive.

The biggest difference comes to JIT-compiling of the pattern.

In PCRE1, JIT-compiling did not modify the processed PCRE pattern,
but returned a new chunk of data.

This allowed multiple threads to keep matching using the same
processed data and NULL for the JIT data, until a thread
JIT-compiled and atomically set the shared JIT data to the results
of the compilation.

In PCRE2, JIT-compiling _modifies_ the processed PCRE pattern in a
way that it's thread unsafe [1]; the results of JIT-compilation
are stored somewhere inside the processed pattern.
This means the above approach cannot work -- a thread may be
matching while another one JIT-compiles, causing a data race.

While waiting for better workarounds from upstream, employ a
read/write mutex to protect the matching from JIT-compilation.

[1] https://lists.exim.org/lurker/message/20160104.105831.3cb25b39.en.html

[ChangeLog][General] QRegularExpression now requires the PCRE2
library, at least version 10.20. Support for the PCRE1 library
has been dropped. A copy of PCRE2 is shipped with Qt and will
automatically be used on those platforms which lack it.

Change-Id: I9fe11104230a096796df2d0bdcea861acf769f57
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 15:22:01 +00:00
Nico Vertriest
ee7a5a94f9 Doc: added spec about parameter enable
Err: Undocumented parameter 'enable' in QNetworkProxyFactory::setUseSystemConfiguration()
Err: no such parameter 'editable' in QComboBox::setCompleter()

Change-Id: Ib27b93cf74e97efd656eda1265003f33c6802005
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-12-12 14:43:34 +00:00
Nico Vertriest
c131a83f42 Doc: update Qt Widgets examples
- \image --> \borderedimage
- update screenshot if required

Change-Id: I0318b1df67154b70c061da7cbd509b8d5337b311
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-12-12 14:43:02 +00:00
Edward Welbourne
3ce6b1e578 tst_QTimeZone::printTimeZone: pass zone by reference
It's a const parameter, so no sense copying it.

Change-Id: I4a673a6a60af9bfe7cb61ce28de2aa295fa1d069
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:59:17 +00:00
Edward Welbourne
c237a8d76f QTzTimeZonePrivate: don't assume int is a 4-byte type
It probably is today, but when the I/O we're doing is explicit about
how many bytes it eats, make sure we're using an explicitly 4-byte
type, qint32.

Change-Id: I48a35fe58043368cdfd096e2628bba410d94ceaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:59:07 +00:00
Edward Welbourne
aa06ea0d8b tst_QTimeZone: tidy up handling of debug member
Make it const, initialize it instead of assigning, consolidate testing
of it round some #if-ery.

Change-Id: I2efbf58292a0edd2ceb3da8d3cc16246e84a3bac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:58:58 +00:00
Edward Welbourne
772b12c436 QTzTimeZonePrivate::init() fix for DST start as standard time changes
Europe/Samara reduced its standard offset at the same time as it
started DST in March 2010, so the transition didn't change net offset.
Our interpretation of the TZ database assumed the prior standard
offset still applied; as this was equal to the new offset with DST, it
marked the dst offset as zero, so we interpreted the next few months
as being without DST, although the TZ database marks it as with.

Generally, if a DST period has an odd DST offset, it's possible it's
due to a change to standard offset at its start.  Deem the offset odd
if it's not what we last saw (or, on the first DST, not an hour); in
that case, check the DST period's end, to see if it offers a less odd
DST offset.  Positive DST offsets are less odd than zero or negative;
otherwise, expect what we saw last, one hour is not odd and closer to
what we saw last is less odd than further from it.  This suffices to
fix Samara in 2010, at least.

Task-number: QTBUG-56345
Change-Id: I9f0ee4e9cd6901c28a8ec1558aec5d26a21152f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:58:45 +00:00
Edward Welbourne
6e3f58cbbe QDateTime, QTimeZone: fix mappings from zone time to UTC
Such mappings are ill-defined in the presence of daylight-savings time
(DST); at its transitions, you need information about whether DST is
active or not to determine the correct UTC value.  Existing code did
not have a way to be told that hint, so could not be correct.

Fixing this required changing the (thankfully private) APIs by which
QDateTime accessed QTimeZone's information stipulated by zone time.
In QDateTime, this required propagating the needed hint, when DST
status was known.

QAndroidTimeZonePrivate overloaded QTimeZonePrivate::dataForLocalTime
with an implementation that works whenever !hasTransitions(); the base
implementation handled this case lamely, so I've moved the Android
implementation there, to have only one place for both re-writes.

Amended tst_QDateTime's expected failures; passing a date and time to
the constructor *is* ambiguous when the moment indicated is in a
transition.  I have changed which way we resolve that ambiguity.

Added round-trip test of QDateTime's fromMSecs/toMSecs (but as a
QTimeZone test, since that's what's actually getting tested), based on
a test-case from Marko Kangas.  Initially failed for various zones,
each at one hour-offset; and, on some platforms, for some zones, at
all offsets.  These last revealed that a platform may claim to have
zone information yet, for some zones, lack it (or have very incomplete
information).  In each case, despite this, the platform does give
offsetFromUtc().  (The test also found another pre-existing bug on
Linux; fixed in an earlier commit.)

To accommodate these gaps in transition data, the transition-based
code now falls back to the offsetFromUtc()-based code (used when there
are no transitions) if it can't find a previous transition (which, in
any case, it needs to do its job).

Task-number: QTBUG-56460
Task-number: QTBUG-56397
Task-number: QTBUG-52284
Change-Id: I2f7422a9e9d3767940b1901d887c6a2c1f36ac9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:58:26 +00:00
Dmitry Shachnev
57b0f54bb6 GTK+ theme: Map some GtkSettings properties to QPlatformTheme hints
Change-Id: If2525e7db0fa496805901174e62f382dd97b2846
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-12-12 13:51:29 +00:00
Giuseppe D'Angelo
1da70af724 QMap: use std::less for defining an order between pointers
Reinterpret_cast()ing a pointer to a suitably sized integer is not guaranteed
to always give the same result for the same pointer (!). Therefore the
resulting integers are not comparable in a meaningful way. std::less is
supposed to be used to compare arbitrary pointers, so use it.

(Hopefully and reasonably, under the hood std::less does exactly what we
were doing, so this isn't BiC.)

Change-Id: I9960b3d6e35657fe7a25b842054f5d338280e850
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 11:15:22 +00:00
Eskil Abrahamsen Blomfeldt
888b3f5045 Fix compilation with -no-pch
Q_UNUSED(cursor) was failing to compile when configured with
-no-pch.

Change-Id: I1da3c95c1636ca06f38a97052ee4360232520a8b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-12-12 11:14:03 +00:00
Eskil Abrahamsen Blomfeldt
7896ae052a Accept ZWNJ, ZWJ and PUA characters in input widgets
Private Use Area characters are quite valid input characters when used
in combination with a custom font. Joiners also serve an important language
purpose in semitic writing systems.

Note that there is a hack where we disregard any character produced
using CTRL or CTRL+SHIFT specifically because of German keyboards. I have chosen to
keep the hack in this patch to limit the change (though I have made an exception
for ZWJ and ZWNJ since both are produced using Ctrl+Shift on Windows), but it
will probably have to be reverted.

[ChangeLog][QtWidgets][Input] Accept characters in Private Use Area, as well as
zero-width joiners and zero-width non-joiners in input in QLineEdit and QTextEdit.

Task-number: QTBUG-42074
Task-number: QTBUG-57003
Change-Id: I73f3b7d587a8670de24e902dc52a51f7721dba5a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-12-12 11:13:53 +00:00
Anton Kudryavtsev
87fefbc08e Plugins: use QStringBuilder more
Change-Id: I6f026b81fdc403d99d37dfa22ea6a27a95ead347
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-12-12 11:02:59 +00:00