Commit Graph

19834 Commits

Author SHA1 Message Date
Rafael Roquetto
684e5587d5 QNX: Fix -developer-build
-developer-build enables -Werror=undef, which uncovered a bug inside
qcompilerdetection.h.

According to the Dinkum headers, it is necessary to account for three different states
concerning the values of the _HAS_* macros:

    1. undefined
    2. 0
    3. 1

Therefore, it is necessary to check both whether it is defined and if it is
not 0. Only checking whether a given macro is 0 will generate a trap by
-Werror=undef.

(__GLIBCXX__ is the sole exception).

Change-Id: Ib95e485698ee38858a1671d930d7e960b75bb041
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-22 18:06:39 +00:00
Morten Johan Sørvig
db2675d6fd Cocoa: Update QWindow::screen() on expose/show.
This is needed to correctly handle show on non-primary
screens.

Change-Id: I80b13372b3a92786987a66f0da385af6b4a6a863
Task-number: QTBUG-47950
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-01-22 13:16:59 +00:00
Anton Kudryavtsev
0f51686a69 QVariant: use reserve in convert()
... to optimize memory allocation.

Change-Id: I7f644955be779c3651683401a7985a265b69ca6f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-22 10:18:34 +00:00
Thiago Macieira
d921a9bd15 Hide better the private API QTextCursor constructors
Both constructors were taking a pointer, so they participated in
overload resolution along with QTextDocument and QTextFrame pointers.

Instead, make them take references and move them to the private section
of QTextCursor. That necessitated adding a method to QTextCursorPrivate
to access that private constructor from non-friend classes.

Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-01-22 03:36:16 +00:00
Thiago Macieira
cfe891eeb8 Add Intel copyright to files that Intel has had non-trivial contribution
I wrote a script to help find the files, but I reviewed the
contributions manually to be sure I wasn't claiming copyright for search
& replace, adding Q_DECL_NOTHROW or adding "We mean it" headers.

Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-21 22:44:21 +00:00
Thiago Macieira
23bd4651c7 Update the Intel copyright year
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.

Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-21 22:44:16 +00:00
Tor Arne Vestbø
a44e4a6cfe Fix build with QT_NO_OPENGL
Change-Id: I3056d101967d94961b35ce10692dc9f390189b40
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-21 21:53:49 +00:00
Tobias Koenig
a01146aac1 Use QFileInfo::exists(f) instead of QFileInfo(f).exists()
QFileInfo::exists(f) is somewhat faster than the version which creates an temporary object.

Change-Id: I5f931a86d9dfad57d99efe04ca115422de43def9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-21 21:21:47 +00:00
Allan Sandfeld Jensen
c7a86c5e0c Remove dead code from QOpenGLPaintEngine
These variables were never used or set to anything meaningfull.

Change-Id: Ic68ac5c38a3db28d7a5a05be004bcb6a554a1483
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-21 20:17:30 +00:00
Tobias Koenig
24d851dcd2 Avoid heap allocations in Median class
Create a MedianDouble class and V2 version of BlockSizeManager, which
use a fixed size array of double (since we always use 7 elements
to calculate the median anyway).

Change-Id: Ife90b90336a9a8c037b90726dee4cd2a1b8b6cd9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-21 18:57:04 +00:00
Jani Heikkinen
f776595cc1 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-21 18:55:18 +00:00
Konstantin Ritt
c3850dd636 QString: optimize case conversion code
Handle special case mapping of length 1 explicitly;
Skip calculating of high surrogate for the same plane;
Optimize branch prediction with Q_LIKELY/Q_UNLIKELY;
Replace peekNext() + advance() with just next() in the caller function.

Change-Id: I0d37969749bd8ca855321242e6a0e72c405c5f8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-21 15:20:41 +00:00
Marc Mutz
5a30884c57 Document qAsConst(), turning it into public API.
[ChangeLog][QtCore] Added qAsConst().

Task-number: QTBUG-50548
Change-Id: Id25592c821808596c6a5768a42b76c1db569f490
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-01-21 09:41:19 +00:00
Laszlo Agocs
7edd488a5f eglfs: Detect llvmpipe and show a warning
Do ourselves and our users a favor by pointing out why Qt (Quick)
apps perform horribly on commonly used distros on the RPi. Using
a software rasterizer on such boards is not going to cut it.

Task-number: QTBUG-50533
Change-Id: I087f502ddb9c6bdde84343e6abd85c87cdc474f0
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2016-01-21 09:16:26 +00:00
Edward Welbourne
1185c28f2f Fix some mis-guided fall-throughs #ifdef QT_BOOTSTRAPPED.
A switch had a case whose body was in a #ifndef; when that got elided,
this case fell through into an entirely misguided case.  Give the #if
a #else clause so that it break;s in the defined case.  Code review
revealed another, then I searched for more following the same pattern.

Change-Id: I57fb59b6c8d349604f3fc6c8b1d424fb3c775d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-21 08:34:27 +00:00
Dmitry Shachnev
19866d8861 Fix pixmap types in org.kde.StatusNotifierItem.xml
According to the spec, pixmap type is ARRAY(INT, INT, ARRAY BYTE).
This also matches our QXdgDBusImageVector typedef.
Also fix the D-Bus Introspection class info.

Change-Id: Ic13e8a078299b9c76d2742055d64cfdc54460d58
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-01-21 07:36:47 +00:00
Liang Qi
158a3a4159 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/corelib/io/qiodevice_p.h
	src/corelib/kernel/qvariant_p.h
	src/corelib/tools/qsimd.cpp
	src/gui/kernel/qguiapplication.cpp
	tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp

Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
2016-01-21 08:17:21 +01:00
Friedemann Kleint
acb2e873f0 QtPlatformSupport: Remove virtual from declarations with override.
Change-Id: If94207596411680dfc2dbe33f298dc48fd5b7cc0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-21 07:17:18 +00:00
Friedemann Kleint
26379d0320 QGnomeTheme: Change the QFont members to pointer members.
When initializing the font members in the QGnomeTheme constructor,
the QFont constructor called QGuiApplication::font() which in
turn calls initFontUnlocked(), initializing
QGuiApplicationPrivate::app_font to QPlatformFontDatabase::defaultFont()
("Deja Vu 12") since QGuiApplicationPrivate::platformTheme() is still
0 at that point.

Change the fonts to pointer members and initialize them
delayed in QGnomeThemePrivate::configureFonts() instead.

Task-number: QTBUG-49095
Change-Id: I3282ea8484e04827be2a424f5ea3e34d607c4bc5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-21 06:02:20 +00:00
Maurice Kalinowski
1f9a06c294 winrt: Fix potential crash in readDatagram
The native socket engine used strcpy for WinRT, which tries to copy
terminating null character. The QSocketNotifier::async_readDatagramSlot
autotest uses a buffer of size 1, which causes readDatagram to overwrite
the buffer on the stack.

Hence use memcpy instead to protect from additional copies beyond
barriers. Note that we cannot use qstrcpy as that does a buf[size-1] =
'\0' at the end, which would remove content for a buf size of 1.

Change-Id: I20baf9e63646cd28c1c954a20b8ae9c7d5873c31
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-21 05:53:45 +00:00
Maurice Kalinowski
f05c597ae5 winrt: msvc2015: refactor file handling
msvc2015 reintroduced a couple of functions from the win32 API
towards WinRT.

Enable usage of those and simplify the file system engine.
Furthermore update the autotests.

Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-21 05:53:17 +00:00
Marc Mutz
f4502fbaf0 [docs] Fix reverse STL iteration example
Use reverse_iterator, now that we finally have it.

Change-Id: If74ead1a6075c5437c1d111206913481a495a014
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-21 05:29:32 +00:00
Thiago Macieira
143c684364 Fix the use of R_X86_64_GOTPCREL on a 64-bit field: it should be 32-bit
The ABI says that PC-relative displacements should be on 32-bit fields,
even on 64-bit builds. For -mcmodel=large, it should use R_X86_64_GOT64
relocations, like 32-bit.

Task-number: QTBUG-50537
Change-Id: I1041122c530b4f5bbaabffff142ade5b3cbfc4c5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-21 05:19:16 +00:00
Thiago Macieira
8cd67bbfac QNetworkInterface: don't add a QNetworkAddressEntry if no IP is known
If SIOCGIFADDR fails, then don't bother trying to get the broadcast
address or netmask, and especially don't add the empty
QNetworkAddressEntry to the interface. This can happen on interfaces
that have no IP address assigned (for example, inactive interfaces).

Change-Id: I8de47ed6c7be4847b99bffff141c326d94ecca78
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-01-21 05:19:10 +00:00
Thiago Macieira
043f5d3eb5 QNetworkInterface: fix handling of interfaces with no addresses
Certain Linux interfaces have no addresses at all (hardware or IP), like
the nlmon interfaces. They weren't being reported.

Change-Id: I8de47ed6c7be4847b99bffff141c2b60c2089ad3
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-01-21 05:19:08 +00:00
Jani Heikkinen
7b2fb038ae Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6 2016-01-21 04:27:06 +00:00
Thiago Macieira
26ece94a68 Move QIpPacketHeader to the header where QNetworkDatagramPrivate will be
Change-Id: I14839ba5678944c2864bffff1417a1d4b790f9c3
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-01-21 01:06:18 +00:00
Marc Mutz
198768cbba QWidget: fix expensive iteration over QMap::keys()
... with iteration over the hash itself.

Can't keep the call to ungrabGesture() in the loop,
because it removes the current element from the very
hash being iterated over. Instead, inline the call
and optimize based on the context:

- don't remove element by element, but clear the
  hash completely at the end.
- drag the check for QGestureManager::instance()
  out of the loop.
- drop the check for presence of the key in the
  hash, since it would be always true.

Change-Id: I6bf7cc8a59a51ccc8046a5b6d1cab5784e79fd55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-01-20 21:17:53 +00:00
Edward Welbourne
9c0de96454 Make some initializers be declarations.
This shortens an earlier over-long line of declarations and makes
visible that these are declare-and-initialize.

Change-Id: I39fa9613196c34f7e2b2da04da729324d7f83a55
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-20 17:13:04 +00:00
Edward Welbourne
57e024cc81 Avoid shadowing a name (and use the outer variable an extra time)
QDateTimeParser::parseFormat()'s top-level scope has a const int max;
this was shadowed by a short-lived max in an inner scope; and the
outer scope's max could be re-used one more time after that to save
re-evaluating the same unchanged expression it held.

Change-Id: I9f07452bb0b4e5ff4bcf6396d42d1419de6276fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-20 17:12:58 +00:00
Edward Welbourne
aa196457da Avoid dereferencing before the start of a string.
A check for a backslash before a quote neglected to pretest that the
quote wasn't the first character in its string.

Change-Id: Ib5226836d1111e37bed984938f7c667be59eb1c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:12:48 +00:00
Edward Welbourne
d8c0bd4207 Make it clearer what's happening with a fall-through.
An if () {...}'s close-brace was hiding on the end of a break; line,
an idiom used in several places for braces that existed to contain a
case (for the sake of local declarations).  This made it hard to see
that there was an if() whose else was the resulting (commented)
fall-through.  So put that close-brace on the comment's line and make
the comment clearly indicate it's an else.

Change-Id: Ie7e7c7063bef96536d6231297b083fc384f2363e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:12:36 +00:00
Friedemann Kleint
191858abe8 QMainWindowLayout::unplug(): Prevent unplugging when the widget is not a window.
Task-number: QTBUG-50490
Change-Id: Icf02e2316bbad0794bd5ac6dccd857bfb28a498b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-20 13:25:57 +00:00
Kevin Funk
8dad3bf212 Fix toDisplayString(QUrl::PreferLocalFile) on Win
When using QUrl::PreferLocalFile we do want to strip the leading slash,
as toLocalFile() would do as well.

Behavior change by means of an example:
  QUrl url(QUrl::fromLocalFile("C:/file.txt")
  url.toLocalFile() --> "C:/file.txt"

Before:
  url.toDisplayString(QUrl::PreferLocalFile) --> "/C:/file.txt"

After:
  url.toDisplayString(QUrl::PreferLocalFile) --> "C:/file.txt"

Task-number: QTBUG-41729
Change-Id: I7d425541f6077ebcf3fcf46feeb7e0f03a0d7fe2
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 13:24:53 +00:00
Marc Mutz
a63a506d54 QSslContext: provide sharedFromConfiguration()
It's a version of fromConfiguration() that returns the QSslContext
instance in a shared instead of a naked pointer.

Use it in QSslSocketBackend.

The idea here, of course, is to use QSharedPointer<T>::create(),
which co-locates the refcount with the payload in a single memory
allocation, instead of QSharedPointer<T>(new T), which causes
two allocations.

Change-Id: Ia5396fb3b291f2912fca5cd97e0aa1e45e065e55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 07:44:08 +00:00
Thiago Macieira
d6bb01e177 Force inclusion of <atomic> on QNX systems.
It's documented to exist in QNX 6.6, which is the minimum required
version for Qt 5.7 anyway.

http://www.qnx.com/developers/docs/660/index.jsp?topic=/com.qnx.doc.dinkum/topic/cpp11/index.html

Change-Id: I7e6338336dd6468ead24ffff141133a2d524f148
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 23:41:55 +00:00
Thiago Macieira
7ffcafd1b5 Remove all the atomic code besides MSVC and std::atomic
[ChangeLog][Important Behavior Changes] Starting with Qt 5.7, Qt
requires a C++11 compiler with support for C++11 atomics. This affects
user code too: Qt headers no longer compile with a C++98 compiler. The
minimum compiler versions for this release are:
 * Clang 3.4 (found in XCode 5.1)
 * GCC 4.7
 * Microsoft Visual Studio 2012

Change-Id: Ib056b47dde3341ef9a52ffff13ef1f496ea9363f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
2016-01-19 23:41:52 +00:00
Marc Mutz
57671bebbc QGraphicsAnchorLayout: remove a misguided use of QLinkedList
QSimplexConstraints are held in QList everywhere, yet one
single function, getGraphParts(), used a temporary
QLinkedList. It did so because the function repeatedly
walks the list, erasing elements from it until no more
elements have been removed.

Thus, in O-terms, QLinkedList is the correct choice here.
Sadly, O-notation completely ignores the per-element cost,
and this is where QLinkedList suffers. By the time a QList
has shifted all of its elements left once, the QLinkedList
probably has just finished allocating its first node.

So, use a QList instead.

That, however, turns the it = erase(it) loop quadratic, so
re-formulate the processing part as a lambda and use
std::remove_if. Don't even erase until we know how many
items to erase.

As a benefit, we save the final conversion of the remaining
items back to a QList, and we can use QList::op+ to build
the initial list, reducing the number of allocations
performed by that container to one.

Also saves ~770b in text size on optimized GCC 5.3 Linux
AMD64 builds.

Change-Id: Iecf9e7961dd2b6b20039b9b0d472e32b3fae6994
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 21:38:24 +00:00
Marc Mutz
7a17340636 QSslContext: separate creation and initialization
This is in preparation of providing a named constructor that returns
a shared instead of a naked pointer.

Change-Id: I23aed950facac9d0b053321e75b61df7df8a6605
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 21:38:19 +00:00
Stephen Kelly
71be92c1d0 CMake: Pass -std=gnu++0x to generated tests in CI.
Add -stdlib=libc++ when using AppleClang.  If CMP0025 is OLD,
the compiler id is 'Clang' for backward compatibility.  So, if on a
CI machine running 'Clang', and on APPLE, use the -stdlib=libc++ flag
too.

Change-Id: I4910000ce08bae1201f7fa0e0eb46622bedd5c4f
Reviewed-by: Kevin Funk <kfunk@kde.org>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-19 14:40:04 +00:00
Topi Reinio
3d82b74c3a Doc: Fix return type of QWeakPointer assignment operators
Imprementation of QWeakPointer assign operators have return types
that are references. However, in qsharedpointer.h where separate
declarations are held for documentation purposes, the reference
qualifiers were missing. This led to incorrect documentation being
generated.

Task-number: QTBUG-49862
Change-Id: I32727762826feb15a3f4f22446e51d2df16e605f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-01-19 14:14:57 +00:00
Liang Qi
8f569c740a Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	config.tests/common/atomic64/atomic64.cpp
	configure
	src/3rdparty/forkfd/forkfd.c
	src/corelib/io/forkfd_qt.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
	tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tools/configure/configureapp.cpp

Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
2016-01-19 10:03:01 +01:00
Eskil Abrahamsen Blomfeldt
b9bd83c9c2 Fix transformed text with DirectWrite engine
This is a port of f54c5d9133d7aa7636988db36fa6cc51d26434b6
from Qt 4.8 which was lost in the transition to Qt 5. It makes sure
we use the correct bounding box for the transformed glyph by
getting from DirectWrite itself.

[ChangeLog][Windows] Fixed transformed text when using the
DirectWrite font engine.

Task-number: QTBUG-50009
Change-Id: I416ab64253165b878af6b9837348134fede8092e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-19 08:29:55 +00:00
Tobias Koenig
c5f7d15765 Replace ffsll with new qCountTrailingZeroBits
Change-Id: I44898909181e25247bf96cf4462971ac23c2a3ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 08:25:02 +00:00
Tor Arne Vestbø
30bff91c39 OS X: Ensure system tray icon is prepared even when menu bar is hidden
On OS X 10.11 (El Capitan) the system menu bar can be automatically
hidden, in which case the menu bar height is reported to be 0 when
using the menuBarHeight API.

This resulted in failing to prepare an image for the system tray
icon item, making the tray item "invisible".

Instead we now use the [[NSStatusBar systemStatusBar] thickness]
API, which returns the correct height regardless of the menu bar
being hidden or not.

Task-number: QTBUG-48960
Change-Id: I208fb8df13754964a6f254cadfbff06dd56c6bab
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-01-19 07:22:35 +00:00
Błażej Szczygieł
465e93aa95 QtWidgets: Improve native and top-level OpenGL widget performance
Since 7c6625b105 native OpenGL widgets
are able to render, but performance is very low.  It also slows down
rendering for top-level OpenGL widgets.

Render-to-texture widgets prevent triggering unnecessary backingstore
painting when only the OpenGL content changes.
This patch makes possible to use that feature for native and top-level
widgets by calling "markDirtyOnScreen()" function only when necessary.

This patch also prevents native and top-level OpenGL widgets from
flickering during resizing.

Task-number: QTBUG-50381
Task-number: QTBUG-49620
Change-Id: I0c16ea644fb869a00772fd74e1709611e627bff3
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-18 18:30:23 +00:00
Tobias Koenig
a87dfdb196 WinCE: Build accessibility support on WinCE7
Build the QPlatformAccessibility support on WinCE7, so
that QtQuickControls, which depend on the availability of
QPlatformAccessibility, can be used on WinCE7 as well.

Change-Id: Ice7370b891a2963483bbfe1af8b219717541e64b
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-01-18 16:41:15 +00:00
Alexander Volkov
9eba208445 Center QPrintPropertiesDialog on top of its parent
Remove QPrintPropertiesDialog::showEvent(). It just accepts
QShowEvent, it makes no sense. At the same time this method
overrides QDialog::showEvent(), which centers dialogs.

Change-Id: I11510feb4a946f347c19d6ac59874b4cb931020e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-01-18 15:57:59 +00:00
Błażej Szczygieł
e8ad49d6cb xcb: Fallback to Xlib screen when glXGetCurrentDisplay() returns NULL
Change-Id: Ie25b3fac4c0224f847c77c0515894a9df84077a2
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-18 14:34:58 +00:00
Morten Johan Sørvig
f634ce3b9a QFocusFrame: Don't crash on null d->widget.
This can happen with a suitably complex use case
(See QTBUG-50263)

Change-Id: Ie8fa7b5872a902e802fda5795ade3369399ddb54
Task-number: QTBUG-50263
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-01-18 12:33:49 +00:00
Giuseppe D'Angelo
5007352164 QOrderedMutexLocker: use std::less to prevent undefined behavior
operator< between pointers is undefined unless the two pointers
point in the same array, which is not what QOrderedMutexLocker does.

Change-Id: Ia6594900cfa807a73f20e157ce896b4321a3d746
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-18 12:20:47 +00:00
Laszlo Agocs
fd6cf5c875 Avoid checking the fb status in every bind
On some drivers (e.g. NVIDIA, tested on Windows) the
status check is apparently expensive. A simple FBO
test app rendering into the FBO on every frame (and
thus calling bind()) shows a 19-21% CPU usage. With
the patch this gets reduced to 0.8-1%.

The check is fairly useless too - whenever creating
attachments, the status is checked, so d->valid is
up-to-date.

Task-number: QTBUG-50496
Change-Id: Ie9f0db34e5c2bc1a1141c734ca0b318419013c0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-18 11:39:24 +00:00
Frederik Gladhorn
bc81a28554 Passing parameters to convertLineOffset by pointer instead of reference
This is aligned with our coding style and it should have been this way from
the start.

Change-Id: I23a00eb220dd9f17d9239c811b556885a2c0186a
Reviewed-by: Fredrik de Vibe <fredrik.devibe@theqtcompany.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-01-18 11:16:57 +00:00
Alex Trotsenko
294111e25a QHttpSocketEngine: ensure pending EOF triggers a notification
When the remote peer closed the connection, a read notification needs
to always be emitted, otherwise the higher layer does not get the
disconnected signal. From the other side, underlying QAbstractSocket
object could temporarily disable notifications from the engine at
any time. To avoid possible blocking of the socket, take a pending EOF
into account when the read notifications are re-enabled.

Change-Id: Iac9d4e2f790530be3500baf5a2000f1f63df5cc2
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-01-18 11:08:34 +00:00
Tobias Koenig
5243696528 Haiku: Fix compilation of corelib
Change-Id: I8f962ac7ee85af50a573a451f54931d6c0dd67eb
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-18 10:47:01 +00:00
Marc Mutz
ea76ab2b2d QtWidgets: replace uses of inefficient QList<QPair>s with QVectors
These QPairs are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by holding them in QVector instead.

Change-Id: I3c205f5326cfd96482563078bdca1747d718457f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-18 10:34:24 +00:00
Eirik Aavitsland
bfd367c6ec Mirclient: update with upstream changes
Merge in the changes up to revision 306 of the lp:qtubuntu repo.

Change-Id: I55dcb9e06e0a3503d6abe4b0894d5ef5a785b6bb
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-18 08:33:04 +00:00
Shawn Rutledge
b30ea41945 eglfs: use QGenericUnixTheme if requested
We need to have reasonable paths for loading icons and such things, just
as in any other Unix GUI environment.  However there is some concern that
it would be too much of a behavior change if there was a theme by default,
so for now it's required to set the env var: QT_QPA_PLATFORMTHEME=generic
That works because QGuiApplicationPrivate::createPlatformIntegration() reads
the env variable and passes platformThemeName to init_platform().
Step 3 in init_platform() does not find a theme plugin by that name
(because QGenericUnixTheme is statically linked via libQt5PlatformSupport.a).
Then in step 4 it iterates the given platformThemeName plus any which
were returned from QPlatformIntegration::themeNames() (which in our case
will be an empty list) and calls createPlatformTheme() with each of
those, until something is returned.  So,
QEglFSIntegration::createPlatformTheme() will be called with the
value of the QT_QPA_PLATFORMTHEME env var, and
QGenericUnixTheme::createUnixTheme() will create the generic, KDE or Gnome
theme depending on that value.

Change-Id: Id16b881819ba872830b019ab147b32fbc2156520
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-18 08:32:59 +00:00
Marc Mutz
89f9f7cbdf QFileSystemModel: replace inefficient QList<Fetching> with QVector
The type Fetching is larger than a void*, so holding it in QList
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by holding it in QVector instead.

Also optimize the append site by liberal use of std::move(). This
code would greatly benefit from emplace_back(), but we can neither
assume it's present in std::vector nor do we require the necessary
C++11 features that would allow us to implement it in QVector, yet
(uniform init and, less so, variadic templates).

Change-Id: I50da0ffd557adff57477245d0e8c1fc1fec1ebc1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:15 +00:00
Marc Mutz
d569f37dfd QGraphicsView: Graph: don't allocate QHashes on the heap
... just so you can observe their absence with QHash::value()
returning nullptr.

Instead, use find() + comparison to end() to detect presence
or absence.

Simplifies quite a bit of code.

Change-Id: Ifd7921bfc8102677ea345ae37d38da31b8105426
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:10 +00:00
Marc Mutz
a0cee9916a QGraphicsView: Graph: remove faulty const_iterator::op=
It failed to copy 'g'.

Fix by letting the compiler generate one.

Change-Id: Ie19fdacb8f27aef821be58c0b727c802d71bfe64
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:06 +00:00
Marc Mutz
1ee43b9b24 QGraphicsView: Graph: don't compare pointers with op<
It's undefined behavior. Use std::less, which has
defined behavior.

Change-Id: I990d197590cf535c1cb5c055d0b6798e602446dc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:01 +00:00
Marc Mutz
f48f8ba0bb QHttpThreadDelegate: use default ctor instead of QSharedPointer(0)
Code like this makes it impossible to provide a templated
QSharedPointer<T>(X*) ctor, so proactively rewrite to use
the proper default ctor, which has the same effect.

Change-Id: I2572e92b12804f873fac4927e93db83f796729f5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:22:56 +00:00
Laszlo Agocs
1172e18c3c Promote backingstore image format to alpha
Like xcb does since 1bcfc3de75.
For TranslucentBackground (ARGB32_Premultiplied) there is no change
in practice. For RGB32 we will promote to ARGB32_Premultiplied
but everything should behave like before, except that we do not rely
on undefined behavior anymore when QOpenGL/QuickWidget is in use. For
RGB16 this will enable QOpenGL/QuickWidget since there the hole
punching mechanism needs an alpha channel always.

Change-Id: Id04ea548cee245ec91642f1358a5e501b62ff64c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-17 01:31:55 +00:00
Swen Kooij
5eec43a44f qdbuscpp2xml: Fixed wrong filename being reported in messages
This caused the filename in messages to be one of the other arguments
that were specified instead of the actual filename.

Caused by the fact that mutations are possibly made to `args` in
`parseCmdLine` and thus the amount of items in `args` does not always
match the amount of items in `argv`.

Change-Id: Ief3716dde39dfdc949a5192e7f83d93cf90130f0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-16 22:11:27 +00:00
BogDan Vatra
9bb24615ad Android: fix native libs dir.
On Andorid 64 bit O.S.s the libs are not located anymore on dataDir/lib/
but they are located on dataDir/lib/<arch>/. Using nativeLibraryDir instead
of dataDir we'll get the right folder.

Change-Id: I40ef9513eb5b51f81032bd41f9943ab7b959ad51
Task-number: QTBUG-50394
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-16 08:52:56 +00:00
Friedemann Kleint
c26562033b QFileDialog: Check whether sizeHint() is valid before resizing.
Fixes a regression appearing in 5.5 where QtWidgets-based file dialogs
showed up too small on Windows.

Change-Id: I5f74ab01d4368d67ab79d3a1b145fb63bdd69ca0
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-01-15 22:34:43 +00:00
Marc Mutz
1a84e55b8f QtCore: replace uses of inefficient QList<QPair>s with QVectors [itemmodels]
These QPairs are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by holding them in QVector instead.

Change-Id: Ie8d8eff3448ada7aef5dfba7fc701a59821f5b54
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-15 21:49:14 +00:00
Allan Sandfeld Jensen
8fd75739ef Lock qfontdatabase mutex in qt_fallbacksForFamily
When called from outside of qfontdatabase, the qfontdatabase mutex will
not be locked upon entry to qt_fallbacksForFamily, so we need to add
it to the exported version.

Change-Id: I16a21708d7cca15730c12de3dbeeaab13ffbd315
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-01-15 19:22:45 +00:00
Alex Trotsenko
982656351b QAbstractSocket: remove redundant handling of recursive calls
Recursion is alredy prevented by the emittedReadyRead member.
Disabling the read notifications also occurs when:

  - a new chunk of data has arrived on an unbuffered socket;
  - the buffer size limit has been reached on a buffered socket;
  - pauseSocketNotifiers() has been called

Subsequent calls to read() or resumeSocketNotifiers() should re-enable
the notifications independently from possible nesting.

Change-Id: I4587265b8d3ed137516e08fbe92dce2f5eab508c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2016-01-15 18:24:13 +00:00
BogDan Vatra
e666ce162b Helper function needed to run Runnables on Android UI thread easily.
Add a function to allow the users to easily run asynchronously Runnables for any thread
directly on Andoroid UI thread.

Change-Id: I631bf8a2c602e038039fec621ec01272af20a400
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-15 16:13:29 +00:00
André Klitzing
5ef14c52d0 Fix QFileSelector::select if called with QUrl and scheme "assets"
QFileSelector::select(QUrl) will use ":" for scheme "qrc" to
call QFileSelector::select(QString). Scheme "assets" needs
to remain "assets:" for select(QString), otherwise it won't
recognize the file in "assets".

Following failed because it was passed as ":/qml/example.qml"
to select(QString):
    select(QUrl("assets:/qml/example.qml"));

This will call select(QString) to:
    select("assets:/qml/example.qml");

Change-Id: I6bdeed6bb67992498ae3b8e1273c20e70049381a
Task-number: QTBUG-50435
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-01-15 13:30:37 +00:00
Jani Heikkinen
1a88b2f768 Updated license headers
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)

Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-15 12:25:24 +00:00
Allan Sandfeld Jensen
4f71654385 Handle RGB30 formats in OpenGL backing-store integration
Optimizes composition on platforms that may use 10-bit per color channel
formats.

Change-Id: Ib303c391d47795c79a4ba55d78dbb1c3c702d90a
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-15 08:59:28 +00:00
Thiago Macieira
434302eae1 Fix non-Latin1 strings in QJsonDocument on big-endian platforms
QJsonDocument stores the entire JSON tree in its binary format. Since
the binary format is the same on-disk as in-memory, it has a fixed
endianness. But when converting from QString to the little-endian
format, the code accidentally converted twice (from little endian, to
little endian), which resulted in a no-op and the string got stored as
big-endian.

It's like encrypting with double-ROT13.

No new testcase because tst_QtJson::removeNonLatinKey was already
failing and gets fixed by this commit.

Task-number: QTBUG-50419
Change-Id: I408dcb81ba654c929f25ffff1428cc79472bbe13
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-15 06:38:53 +00:00
Thiago Macieira
d53f614740 Doc: add missing semi-colon
Change-Id: I408dcb81ba654c929f25ffff14291c57198e7367
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-15 06:38:50 +00:00
Friedemann Kleint
b6c086ad6c Windows/Direct2D QPA plugins: Fix overrides.
Fix warnings found by clang.

Change-Id: Ia8e7a271e9d33011eded1e63e61dbcaeaf692600
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-01-14 16:57:59 +00:00
Allan Sandfeld Jensen
0bc4288689 Optimize OpenGL binding of ARGB32PM backing store
Detect premultiplied backing store and upload it without conversion
and adjust blend to not multiply alpha again.

Task-number: QTBUG-50381
Change-Id: I51939c4f82fbb0c48eaca6e2475bf4cf3722bc2d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-14 13:28:57 +00:00
Anton Kudryavtsev
f1b796e3ba QHttpNetworkRequestPrivate: perform init by init-list in ctor
Change-Id: I2a8ced0eff726911daa71eb11e135f69612a9090
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-14 12:49:49 +00:00
Marc Mutz
ed45af5f3c QXcbXSettings: don't construct a QByteArray just to append it
... use QByteArray::append(char*,int) instead.

Also cache the return value of the out-of-line function
xcb_get_property_value_length().

Saves ~120b in text size, and a heap allocation.

Change-Id: I4d1deafdcd3345f2b7dfbf8c45702cfee733a269
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-14 12:48:16 +00:00
Marc Mutz
a836b4735c QXcbXSettings: replace a QLinkedList with a std::vector
Required to change an erase() loop into std::remove_if to
avoid running into quadratic behavior.

While at it, made QXcbXSettingsCallback a proper struct,
used aggregate initialization, and ported another loop to
C++11 range-for.

Saves ~0.5KiB in text size on optimized GCC 5.3 Linux AMD64
builds, and a lot of heap allocations.

Change-Id: I228bb853519ed2590375dc511e527f47bb8daa34
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-14 12:48:10 +00:00
Błażej Szczygieł
18119a58de xcb: Don't clear alpha on every repaint
Since 1bcfc3de75 every image has alpha
in XCB even if it is not used by window. This patch prevents clearing
the alpha channel on every repaint when window is not transparent.

Change-Id: Icfdd39f8636401906ace77ea3c2fa25386979d5f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-14 10:47:10 +00:00
Maurice Kalinowski
c3376ed3f9 winrt: enable hardware buttons for Windows 10
Previously the hardware and camera button handler were guarded inside a
Q_OS_WINPHONE which does not apply to Windows 10.

Instead use WINAPI_PARTITION_FAMILY like on other places, this covers
Windows Phone 8.1 as well as Windows 10.

To find windows.phone.ui.input.h at build time the Mobile Extension
directory needs to be added to the include paths inside qmake. On
runtime we need to check whether we have hardware buttons or not. In
case they exist, register the handlers, otherwise skip registration.
Skipping also helps to keep WACK succeeding.

Task-number: QTBUG-50427
Change-Id: Ibeae15dbde12553cebd2b73b1a40b754c014f426
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-14 07:43:26 +00:00
Anton Kudryavtsev
fb1863e64a QPathSegments: set pathId to zero in ctor
Change-Id: Iaa4349914fbeca9c64863addb9892412e1bad65b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-14 05:25:20 +00:00
André Klitzing
f831c97a08 Replace QStringLiteral with QLatin1String in QFileSelector
Change-Id: I5c109d26bf5252947ae016465db5675e38cd68c9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-13 22:06:32 +00:00
Volker Krause
b5447f9c33 QtConcurrent: Avoid an allocation in ExceptionHolder if there is no exception to store.
Qt3D hits this several times per frame.

Change-Id: Iaadcfbe79f146bd73b36f01325580dc24a10225c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-13 22:06:25 +00:00
Błażej Szczygieł
7b63c45df5 QtWidgets: Don't show window of native widget with WA_OutsideWSRange
This patch prevents visibility of native widgets which for some reasons
has width or height of 0.

Due to async expose event in Qt5 we must force "hide_sys()" during
resizing for widgets with WA_OutsideWSRange flag. This avoid problems
for non-native and visible widgets which are converted to native and
then resized:
child->winId();
child->resize(0, 0);

Task-number: QTBUG-49445
Change-Id: Ied62a4f253f89447941b2dc03316db8c168f4bb5
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-01-13 19:02:34 +00:00
Błażej Szczygieł
a9c0a83207 xcb: Don't duplicate expose events
Use ExposeCompressor for mapping the window to prevent duplicating
expose event when window is mapped.
Remove sending expose event from configure notivy event.

Change-Id: I6836c06047ffebd65775aa8aca90750afba6efe8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-01-13 19:02:29 +00:00
Alex Trotsenko
184d66caa5 QDataStream: handle incomplete reads from QIODevice
This adds a way to resume reading from a stream after a ReadPastEnd error.
This is done by introducing a stream read transaction mechanism that keeps
read data in an internal buffer and rolls it back on failure.

[ChangeLog][QtCore] Added QDataStream startTransaction(),
commitTransaction(), rollbackTransaction(), abortTransaction()
functions to support read transactions.

Task-number: QTBUG-44418
Change-Id: Ibf946e1939a5573c4182fea7e26608947218c2d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-13 16:31:33 +00:00
Edward Welbourne
cd9625fc3c Correct floordiv() to cope with implementation-defined division.
Irrelevant once we get to C++11 (so we can revert this in 5.7), but
division's rounding direction is implementation defined when either
operand is negative [0].  The prior code assumed C++11's truncation
(a.k.a. round towards zero), but rounding may be downwards instead.

[0] http://en.cppreference.com/w/cpp/language/operator_arithmetic#Multiplicative_operators

Change-Id: I2b6b27e1cf629def48b25433e81b9ed8230d8795
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 13:58:49 +00:00
Morten Johan Sørvig
eef7725775 eglfs: Round value returned from pixelDensity()
Avoid returning fractional scale factors, which we
do not support. This matches the pixelDensity()
implementation for the Xcb and Windows platform plugins.

Change-Id: I79156e802a0a436b9344f12d35d1f4861e20e7fa
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-01-13 12:55:15 +00:00
Andy Shaw
8c89a8b1ef [Android]: Java uses some deprecated locale codes so account for these
There are three deprecated language codes that Java still uses for the
locale so we need to account for these inside QLocale by mapping them to
the right language.

Task-number: QTBUG-49632
Change-Id: Ib66b3f2763e085f7384228f2490b048bb56be259
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-13 12:37:56 +00:00
Erik Verbruggen
6ffa3696e0 ARMv8: Update qHash for strings to use the CRC32 instruction
Same as the SSE4.2 implementation: use the (optional) ARMv8 crc32[bhwd]
instruction to calculate hashes for strings. For Aarch64, support for
the instruction is dynamically detected. For a 32bit ARM binary, dynamic
detection is only done when the compiler is explicitly told to target
ARMv8. When telling the compiler to target an other/older version, the
crc32 code is not compiled.

Change-Id: I51ebc1a4545dede4988247e75043f29a64c2a6c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 09:05:06 +00:00
Erik Verbruggen
4417458d62 ARMv8: add crc32 feature detection.
Change-Id: I3cfac90dfa137d0bf3d124d87262eb2dbb56459c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 09:05:01 +00:00
Simon Hausmann
9a969182cf Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-13 07:19:44 +00:00
Dan Cape
f7020a31c0 Add ability to specify precision of float/double currency strings
Added a new overload function that allows the developer to
specify the desired precision. Until 6.0, it will require
the symbol and precision to be passed to it. Once Qt is at
version 6.0, it will replace the overload function that
requires a value and optionally a symbol.

[ChangeLog][QtCore][QLocale] Added an overload for toCurrencyString()
that allows the decimal precision to be specified.

Change-Id: I1fb7dde3583f46de2ed20ec2a7abaeca23a903ef
Task-number: QTBUG-46595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 06:35:14 +00:00
Marc Mutz
61169b72c2 Fix UB in QIODevicePrivate
Passing nullptr as the second argument of memcpy/memmove
constitutes undefined behavior, even if the length argument
is zero at the same time.

Fix by protecting mem{cpy,move,chr} from nullptrs.

Found by UBSan:
  qtbase/src/corelib/io/qiodevice_p.h:105:33: runtime error: null pointer passed as argument 2, which is declared to never be null
  qtbase/src/corelib/io/qiodevice_p.h:175:53: runtime error: null pointer passed as argument 2, which is declared to never be null

Change-Id: I979158b0a74169ca4eb459928398ebc40f77dfb5
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 05:42:35 +00:00
Sérgio Martins
e770728a33 Add Qt6 TODO to remove copy-assign operator and copy-ctor
Change-Id: I5d80b272f31ada58d4eb7c19051fe447d6241633
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-12 23:52:35 +00:00
Tor Arne Vestbø
1e15b428b5 Fix shortcut modifiers not being propagated after c7e5e1d9e
The code-path used by non-OSX platforms were not passing on the native
scan-code, virtual key, and modifiers, breaking QKeyMapper::possibleKeys
in the process.

Task-number: QTBUG-50360
Change-Id: Idc36380a234f0a37d016dbeaca594aeb82c496d2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
2016-01-12 22:08:09 +00:00
Tor Arne Vestbø
af45b352d7 Fix reentrancy regression in QShortcutMap after c7e5e1d9e
When closing a popup dialog using a shortcut, when the popup
was originally opened using a shortcut, the closing-shortcut
would interfere with the state of the first shortcut, and we
ended up sending a key event for the original shortcut.

Task-number: QTBUG-50360
Change-Id: I62e5ddb9ca43b28519ede629775bc0d7598dccc4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-12 22:08:04 +00:00