Commit Graph

22902 Commits

Author SHA1 Message Date
Thiago Macieira
a0e693b1e8 QtXml: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c94686ec193958
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 01:50:23 +00:00
Thiago Macieira
ff807df6c9 QtDBus: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c9468642b2db83
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 01:50:21 +00:00
Frederik Gladhorn
3dbb526329 Fix regression in time zone handling
In QtScript we use the msecs since epoch conversion (JS date is based on
the concept). After a8c74ddcf7 the date
conversion test in qtscript started to fail. Instead of relying on the
code working by chance, simply update the date when setting it with
setMSecsSinceEpoch.

Task-number: QTBUG-44885
Change-Id: I9f95c9cdccea52e7d1f808f3cb9e18570ef0df13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-11 01:50:08 +00:00
Lars Knoll
a29b7635bd Simplify calculation of week number
This also removes a dependency to 3rd party licensed code.

Change-Id: Ia4818a5cf306501bdb7192265edc4bcba8e597d8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-10 13:36:49 +00:00
Tor Arne Vestbø
de92efd448 CF event dispatcher: Decide if eventsProcessed before breaking out of loop
In the case of calling processEvents with WaitForMoreEvents and ending up
processing a Qt timer, we explicitly interrupt the runloop, as CF doesn't
normally treat handling timers as having handled a source. That way we
can re-evaluate whether processEvents should return.

But, we need to compute eventsProcessed before breaking out of the
Q_FOREVER loop, otherwise processEvents will return false when
waiting for events and processing a timer.

Change-Id: Ie5f8905228cce1508b5b2e040cf1186820855191
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-10 12:48:32 +00:00
Tor Arne Vestbø
dfd6fc7bce iOS: Only use root level native runloop if at first level of processEvents
We used to support calling QEventLoop::exec() from within a processEvent
recursion and still jump down to the root native runloop, but this does
not work as intended due to how QEventDispatcherCoreFoundation uses
flags in its ProcessEventsState for e.g. deferred wake up or timer
updates. The logic in QEventDispatcherCoreFoundation assumes that
the next recursion to processEvents will be handled by itself, so
that it can interpret the flags in ProcessEventsState. The iOS
event dispatcher subclass, QIOSEventDispatcher, does neither of
these things, and should only be used from a 'clean' state.

Change-Id: I44fa156feecc45772806002465c35bef0797ead2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-10 12:48:16 +00:00
Tor Arne Vestbø
4c542ab592 iOS: Handle an QIOSViewController outliving its related QIOSScreen
We release the UIWindow that retains QIOSViewController in the
QIOSScreen destructor, but other parts of the OS may have retained
the view controller, so the dealloc may not happen until later. In
the meantime we may receive calls to shouldAutorotate, so we need to
guard this code for the situation that m_screen has been deleted.

Change-Id: Iefeb75f4fc698b5e80417ffd3a971b7de625bcd5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-10 12:46:37 +00:00
Allan Sandfeld Jensen
3ce88e13b9 Add AVX2 autovectorized versions of premultiply
Following up on using GCC's autovectorizing for faster SSE4.1
premultiply, this patch adds specialized autovectorized versions
of premultiply for AVX2, giving another almost doubling in speed.
To make the speed up for AVX2 and also SSE4_1 available to non-GCC
compilers, the target-specific methods have been moved to separate
files.

Change-Id: I97ce05be67f4adeeb9a096eef80fd5fb662099f3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-10 12:28:13 +00:00
Ulf Hermann
1fc6056ff5 Detect qt.conf in bundle on OSX without QCoreApplication
On OSX we don't need the applicationDirPath to find a qt.conf
located in the application bundle. Let's take advantage of this and
allow findConfiguration to use it.

Task-number: QTBUG-24541
Change-Id: I38c349a3bcd140fcf91352c88c24ca662e6e6f2e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-10 11:56:53 +00:00
Ulf Hermann
d96c29a5d1 Reload QLibraryInfo's settings when QCoreApplication becomes available
Some of the paths may only be resolvable if the application path is
known. On some platforms we can only figure out the application path
if argv[0] is known. Thus, if the paths have been queried before the
QCoreApplication is created, the cached settings may be wrong. We have
to reload them after creating the QCoreApplication.

Task-number: QTBUG-38598
Change-Id: Idf5822be87aa0872b099480040acd7b49939a22c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-10 11:48:24 +00:00
Alex Trotsenko
35ee5349f2 QIODevice: Fix some 64-bit issues
Change-Id: I77354a3069b256135c5792975a1445bcbe816e20
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-10 11:45:41 +00:00
Frederik Gladhorn
971b8413f2 QAbstractButton: emit released on focus out or disable
When pressing a button with the mouse and then moving the focus away,
the internal and visual state of the button would get updated, but the
released signal would not be emitted.
The same goes for disabling the button, although in 99% of the cases,
disabling the button will also move the focus, so the first case
already takes care of emitting the signal.

Task-number: QTBUG-42775
Change-Id: Ib6ba8e0a75f0349b66d1e799b02bd8498db85022
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-10 11:35:32 +00:00
David Edmundson
4c0c537421 Avoid detaching pixmaps when it has not changed
setDevicePixelRatio is often called unconditionally even when the
devicePixelRatio matches the pixmap or image.

This causes a lot of unncessary detaches wasting some memory.

Change-Id: I27535b2b22312ec0edc9bdc00c99d322afb727c1
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-09 21:14:16 +00:00
Frederik Gladhorn
1cc8ec1e78 Remove cruft
Change-Id: I8e0bf5b9befb0e9639da15b07072d046c038ea85
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-09 21:07:20 +00:00
Laszlo Agocs
6653e49cf2 Add missing flush for multisampled QOpenGLWidget
QOpenGLWidget exhibits the same issue as QQuickWidget in the linked bug.

Task-number: QTBUG-39917
Change-Id: Ib231fb88f73c6ef68f12cc3fecf462679e8184a7
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-03-09 14:49:31 +00:00
Eskil Abrahamsen Blomfeldt
ac3502345f Fix design metrics for text on Windows
The trick to get design metrics on Windows is to request the
font with the design size, however we were passing the em square
size in as the cell height instead of the em square size (aka
character height in Windows docs). This would give us hinted metrics
and thus the design metrics would differ from other platforms.

[ChangeLog][Windows][Text] Fixed design metrics for text

Task-number: QTBUG-44501
Change-Id: I4cffc3b86359cfdaf2ece07e1259f6fa862132bc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-09 14:45:06 +00:00
Venugopal Shivashankar
3e6a14168b Example: Removed the code to handle 'num_entries' info.
The Google Suggest API doesn't return the 'num_queries'
anymore. Had to remove code related to 'num_queries' entry
so that the suggestion list shows up.

Task-number: QTBUG-42817
Change-Id: Ic918d1c86840fa4c1e18f32a984f5a9dd911261d
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-09 14:21:08 +00:00
Samuli Piippo
b0ae0db61a Remove neon command line options from configureapp
Neon support needs to be enabled unconditionally in mkspecs, so removing
-neon and -no-neon command line options from configure app. It now has
the same functionality as configure script.

Task-number: QTBUG-44690
Change-Id: Iaf5bf7ac4e11fcb798f643660e48a4ed3ce1036b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-09 14:19:31 +00:00
Samuli Piippo
a31823176a QNX: enable Neon support to be compiled in for QNX
Neon detection in configure does not work unless correct
flags are passed to compiler.

Task-number: QTBUG-44690
Change-Id: If119cc9ed80275aaa8796c1be8853559a7670d6a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-03-09 14:19:24 +00:00
Thiago Macieira
afe3e24711 QPA plugins: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c946899b4ba15b
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-09 13:21:38 +00:00
Tor Arne Vestbø
3d7a0111e3 iOS: Auto-detect available devices when running make check for testing
Change-Id: I447d8faf421c31de68dde64211b795eaccec17a4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-09 13:01:28 +00:00
Tor Arne Vestbø
17d690952b iOS: Use Xcode project to filter out environment variables instead of shell
Xcode has a setting for script phases to filter out the environment
variables, so we don't need to use grep.

Change-Id: Ica1c64321385ab3e3b47cf6f8f4d4191bd963540
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-09 13:01:12 +00:00
Konstantin Ritt
58073a02fc [QFontEngineFT] Use FT_Library associated with a given face
Change-Id: I4f9927e2c5cb014523bebbe9c719aca89bb86019
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-09 12:34:56 +00:00
Andy Shaw
72ef272733 (Re)introduce loopLevel into QThread
This function used to reside in QEventLoop in Qt 3 and was deprecated in
Qt 4. However this is useful for those who want to know how many event
loops are running within the thread so we just make it possible to get at
the already available variable.

Change-Id: Ia6a7d94ff443a1d1577633363694bc2fa8eca7e4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-03-09 12:29:43 +00:00
Allan Sandfeld Jensen
1edd16879c Fix building tests on QNX
Use qmath and cmath methods instead of math.h methods.

Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-03-09 11:23:24 +00:00
Laszlo Agocs
3fea1e53a1 Add joystick/gamepad recognition to device discovery
And to keep things readable, migrate to categorized logging.

Change-Id: Ie9d82bb4e93d3b96f1a7bf54a37cfde4a941bc7d
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-03-09 11:13:54 +00:00
Andrew Knight
0fce009f1c eglfs_kms: remove deprecated QString uses
Fixes "warning: ‘QString::QString(const char*)’ is deprecated"

While we're here, make the locals const.

Change-Id: Iee70253a46f91937b93e06cc08cd361716cd669d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-09 11:10:10 +00:00
Nico Vertriest
59495d180b Doc: removed invalid warning about Qt stylesheets
Task-number: QTBUG-44549
Change-Id: I386e75ae5c931f49a0198ae1f24706899bdedd94
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-09 10:38:13 +00:00
Nico Vertriest
6c099c2128 Doc: added doc QProgressBar about undeterm. state
Task-number: QTBUG-43345
Change-Id: Ie8bda9dbe0ca2f713451f3ec2f68467a064f7f2c
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-09 10:37:56 +00:00
Nico Vertriest
162c116948 Doc: corrected doc QString::operator[]
Task-number: QTBUG-43337
Change-Id: I379dfe3f6909de5a63a67261834ea0edff875f9d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-09 10:37:40 +00:00
Shawn Rutledge
21a0e3c111 Android: don't assume a stationary touchpoint unless all history agrees
We need to compare each historical location (not just one of them)
against the present location to prove that the touchpoint didn't move.
We still don't actually send events for every historical touchpoint
location though, because that would multiply the event traffic.

Task-number: QTBUG-38379
Change-Id: I4b968ef6877031a157493d0a248564c78195c033
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-03-09 10:20:06 +00:00
Friedemann Kleint
3ff80d1fe4 Windows printing: Add more error reporting.
Task-number: QTCREATORBUG-13742
Change-Id: Ic234c7e86531c0924ddc03c63cd50b442bdcc9e9
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-03-09 07:56:40 +00:00
Thiago Macieira
1cd8d67d5f Fix NTLM possible data corruption
A mistake in const correctness resulted in the incoming QByteArray
getting modified when it shouldn't. I have no ldea if this could result
in user-visible effects.

Change-Id: Ia0aac2f09e9245339951ffff13c8d8c6b4f909bd
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-03-07 21:32:41 +00:00
Thiago Macieira
53ce0d1a31 QStringAlgorithms::simplified_helper: add missing check for detached
Otherwise, we modify shared strings that happened to be rvalues.

Task-number: QTBUG-44706
Change-Id: Ia0aac2f09e9245339951ffff13c85bfc912f03d1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-07 19:36:24 +00:00
Thiago Macieira
a8c74ddcf7 Fix race condition in QDateTime::timeZone() and other methods
When timezone support for QDateTime was added, we decided it was a good
idea to delay creating the QTimeZone object and checking that the time
is valid in that timezone (including for local time) until the user
requested that information. Unfortunately, QExplicitlySharedDataPointer
returns a non-const T* in operator->(), which meant we were accidentally
modifying the d pointer's contents in const methods, which in turn means
those const methods were not thread-safe when operating on the same
object.

This commit changes the d pointer to QSharedDataPointer, which is safer
in this regard and pointed out where the issues with constness were
located. Since we can't lazily calculate QTimeZone anymore, we need to
do it whenever the date, time or offset changes.

Task-number: QTBUG-43703
Change-Id: Ic5d393bfd36e48a193fcffff13b9686ef4ef1454
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 19:22:21 +00:00
Thiago Macieira
84b9d07163 Silence bogus MSVC warning about variable not used
The compiler is wrong: the variable was used in the previous line.
However, the line had no effect for a type T that has a trivial
destructor, so the optimizer must have discarded the line and the
reference to the variable before the checker for used variables.

qsharedpointer_impl.h(247) : warning C4189: 'that' : local variable is initialized but not referenced

Change-Id: Ia0aac2f09e9245339951ffff13c8bde02bb46816
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-03-07 19:21:51 +00:00
Tor Arne Vestbø
8972ceea87 iOS: Enable runnnig Qt tests using 'make check' via xcodebuild test
Change-Id: I1692cf3eb34726c15eaa969a369bb97a89773bfd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-03-07 11:38:14 +00:00
Martin Smith
495b3d357d qdoc: Fix regression in Node type testing
When support for documenting JavaScript was added to qdoc,
some tests qdoc uses to determine whether an entity is a
QML signal or a QML method were modified incorrectly, a
case of premature optimization. This caused QML methods to
be listed as QML signals in the documentation. This update
corrects those tests.

Change-Id: Ie6d5b43a03a6f3ae39982292cb9ad92952de0bff
Task-number: QTBUG-44825
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-07 09:47:32 +00:00
Martin Smith
100ffb60ef qdoc: Teach qdoc to resolve namespaces
It turns out this bug was caused by modularization,
which created the situation where members of the Qt
namespace are in different modules. Most are in QtCore,
but a few are in QtGui.

qdoc was creating a namespace node for the Qt namespace
in the node tree for QtCore, and another namespace node
in the node tree for QtGui. This meant that there were
two NamespaceNodes for the Qt namespace. Correctly, only
one of these nodes contained the text for the \namespace
command for the Qt namespace. This was the namespace node
that was being used to create the HTML reference page for
the Qt namespace.

Unfortunately, the Qt namespace node in the tree for QtGui
was not being merged into the Qt namespace node in QtCore,
so some of the members of the Qt namespace were not being
shown on the reference page.

This update teches qdoc how to merge namespace nodes to
ensure that all the members appear on the reference page
for the namespace. There can be a namespace node for the
namespace xxx in any number of modules, but they will all
be merged into the namespace node for namespace xxx that
contains the qdoc comment for \namespace xxx.

Change-Id: I0f6a653ea6f920aacd5d8e13f9865488d95f6458
Task-number: QTBUG-44688
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-07 09:47:23 +00:00
Martin Smith
94bad40392 qdoc: Remove unnecessary ifndef Q_QDOC
It was preventing some functions in the Qt namespace
from being documented and hence auto-links to these
functions failed.

Change-Id: Ie820eb7c8172deac40554e993e4d61a765a616f4
Task-number: QTBUG-44688
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-07 09:47:13 +00:00
Tor Arne Vestbø
d5e56fd913 Xcode: Make QMAKE_MAC_SDK_(PLATFORM_)PATH depend on active SDK
The Xcode project generator doesn't support exclusive builds, and always
runs as the default debug/release config, and with iPhoneOS as the target
platform. This means we need to parameterize the QMAKE_MAC_SDK_* build
settings to depend on the currently active SDK in Xcode, so that the
paths, when used in eg. linker flags, are up to date.

Change-Id: I9ca10f794e14ab440d98820657758b3fd8a7cdb0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-03-07 01:57:48 +00:00
Tor Arne Vestbø
f58933f2a9 iOS: Resolve QT depends before checking if we need to link in platform plugin
The logic failed for cases like QT += core widgets.

Change-Id: Ic49c1a2314a4698b03956acbd6778b658326f3e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-03-07 01:57:47 +00:00
Laszlo Agocs
e8f4ae5559 Clarify QMatrix4x4::lookAt() docs
Task-number: QTBUG-44603
Change-Id: I72d143a5d9ddd31ab1b64788cc0e2dd4fca2531c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-03-07 01:14:56 +00:00
Konstantin Ritt
da681a41cb Introduce QQuaternion::rotationTo(vecFrom, vecTo)
which returns the shortest arc quaternion to rotate vector from
to the destination vector to.

Change-Id: Ibd7a746789ecdfe6f7fe17e4ac9049f7ac46560d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2015-03-07 01:14:15 +00:00
Konstantin Ritt
1e441d298d [QQuaternion] Add a way to convert to/from orthonormal axes
It is just a convenience wrapper
around convertion to/from the rotation matrix.

Change-Id: I27511b43866827172960b0152f1c7b65da857f6f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 01:14:04 +00:00
Konstantin Ritt
c4aea1ea20 [QCoreTextFontDatabase] Minor clean-up
Change-Id: I4579d4c4a516cc458aa7ddd8aca385b4ae21879b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 01:13:35 +00:00
Konstantin Ritt
9a3754c570 [QCoreTextFontDatabase] Micro optimization
With use of pre-allocated buffer, there is always a good chance
to get the requested data with a single call.

Change-Id: I8fed718e15970ab345ce96a9405578947b59f311
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 01:13:24 +00:00
Friedemann Kleint
8f1eb52525 Windows: Fix build of qwindowsfontdatabase.cpp with MinGW 4.9.2/-Werror.
Disable warning:
qwindowsfontdatabase.cpp: In member function 'virtual QFontEngine* QWindowsFontDatabase::fontEngine(const QByteArray&, qreal, QFont::HintingPreference)':
qwindowsfontdatabase.cpp:1111:74: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Change-Id: Ifce69db7d1f3b78d52e5b4e01db8e7bbfb62b439
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-03-06 22:18:15 +00:00
Katja Marttila
7c3cfdbcb7 Add getter for QSizePolicy to SpacerItem
Change allows to change width and height with
changeSize() method without changing size policy.

Task-number: QTBUG-38518
Change-Id: I3eabb5fbfd9792c57c0a533ce14ec99b64603631
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-06 19:55:20 +00:00
Shawn Rutledge
483328a956 docs: QPlatformWindow::screen() and QWindow::screen() can return null
After change f4b8697c40, it is normal
on X11 to have a null screen when all outputs have been disconnected
or turned off.

Change-Id: I97eeefd86d97701be50f0757fe5c53ca36d79aaa
Reviewed-by: Harri Porten <porten@froglogic.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-06 19:55:07 +00:00