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>
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>
This also removes a dependency to 3rd party licensed code.
Change-Id: Ia4818a5cf306501bdb7192265edc4bcba8e597d8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Use qmath and cmath methods instead of math.h methods.
Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
And to keep things readable, migrate to categorized logging.
Change-Id: Ie9d82bb4e93d3b96f1a7bf54a37cfde4a941bc7d
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
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>
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>
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>
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>
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>
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>
Change-Id: I1692cf3eb34726c15eaa969a369bb97a89773bfd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
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>
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>
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>
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>
The logic failed for cases like QT += core widgets.
Change-Id: Ic49c1a2314a4698b03956acbd6778b658326f3e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
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>
It is just a convenience wrapper
around convertion to/from the rotation matrix.
Change-Id: I27511b43866827172960b0152f1c7b65da857f6f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
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>
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>
Whenever a QWindow is associated with a QScreen, the screen is expected
to be a real working one, so that rendering continues to be possible.
This partially reverts 52f5e50f11
[ChangeLog][QPA][Xcb] If all QScreens (xcb outputs) are disconnected
while an application is running, QGuiApplication::primaryScreen() will
return null until a screen is connected again.
Task-number: QTBUG-40174
Task-number: QTBUG-42985
Change-Id: Id1b29dd70eaf3f2e7fd477516ce7e2bf24e095f6
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>