ARM and x86 platform defines are identical, so they can be kept in a
common file.
Change-Id: I6f79cadb2e5ce265e4a5a7a0806379dc8793e539
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
QSharedPointers here are passed by value - good, since it enabled C++11 move semantics,
transparently.
However, when passing such parameters on to assignment operators or other functions,
copies were made where moves would have been sufficient. Thus, add some qMove()s.
Change-Id: Ied1a5edf1bfbb16108dfeefbe85e58ab3d4ef92f
Reviewed-by: Richard J. Moore <rich@kde.org>
xcb atoms are uint32s, so a QList of them wastes 50% memory on 64-bit
platforms. Other parts of the code already store xcb_atom_t's in QVector,
so use QVector everywhere (also leads to less code expansion).
Change-Id: Ib4afb35e499577a7509d04a18b830d9b31f6abd0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The Transaction type is larger than a void*, so better use
a vector to hold them.
Change-Id: Ie2c00d053f67addbce6fd8107f659c56ccdd37aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The code populated two QSets with some x and y coordinates and went
on to get the values as a list. Since QSet is unordered_set, those
lists were not sorted, so the code did that manually. It then went
and created the cross product of the two lists as a list of QPoints.
Since QSet is a node-based container and not even an ordered one,
the code pays a hefty price just for ensuring uniqueness of values
prior to sorting.
The new code just cramms everything into vectors, duplicates and all,
then sorts the vectors and only then removes duplicates using
std::unique. Since the sizes of all containers involved are known
ahead of time, make liberal use of reserve() to trim the whole
container business down to three memory allocations.
Change-Id: I7004b1b90b3142acb12d7bb12bcd0014d54e6e02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
A QList<QRect> is horribly inefficient, and this is private API, so we're free to
change it.
Change-Id: I26c2be51393f883d160b86ed1414f801f211df39
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QList<QRectF> is horribly inefficent, and this is just implementation,
so we're free to change it.
Change-Id: I7b28a2093efb5826b55c172f48a81cb9c2472e5a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
Change-Id: I9be380cbb7bed4cd95515074c7cad7e41a511dc9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Output the file name and fix line number to be 1..n.
Change-Id: I3ba7f84b99ce3664bc3e403b230307511b15fe1f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
In order to have the possibility to provide a custom QSystemTrayIcon
implementation in the platform theme instead of the X11 xembed based
one, the qpa implementation needs to be called. This was not possible
as qpa and x11 implementation were compile time mutual exclusive.
This change moves the qpa implementation in the shared part and the
methods in qsystemtrayicon_qpa just delegate to them. In addition the
_x11 part tries to create a QPlatformSystemTrayIcon through the
platform theme and if that succeeds the implementation prefers the qpa
variant and delegates to the same methods.
Change-Id: I6b33acac63524a77ebdce39af6eb74666f8c7561
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This should allow more compilers to use the shorter & simpler version of
the macro.
Change-Id: Ibd2bf20f479b707a7806d0265a5580ebfc2e7733
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It's possible to do without them, which probably makes the number of
supported compilers a lot bigger: they just need to support decltype()
or __typeof__.
That includes the Intel compiler. The old code was also apparently
working, but no one had realized the old workaround for some old version
was still in place.
The loop overhead is more or less the same. I have not done benchmarks,
but inspection of the generated assembly shows more or less the same
number of instructions.
Change-Id: I32d499c84a6ddd19d994b49f17a469acb5c3a3f1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It is in nearly all cases much faster (in our benchmark it is
about a factor 8) - and it also makes the code more readable.
Change-Id: I075e1d1a96756e5e9a2bf53b5479094f7d87883d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
updateBlock is part of the interface of QAbstractTextDocumentLayout
however QTextDocumentLayout implementation is not invoking it.
This commit adds similar behavior to QTextDocumentLayout as the
QPlainTextDocumentLayout (QtWidgets) has by implementing the missing
functionality.
[ChangeLog][QtGui][QTextDocumentLayout]
Emit updateBlock signal in QTextDocumentLayout.
Task-number: QTBUG-36743
Change-Id: I7f812d4d5d7c2148393ee672fb0db6c0b2e73783
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This fixes compilation of Qt for Android when configured with
"-no-widgets". One good use-case for that configure switch is
that QtSvg loses the dependency to QtWidgets.
Change-Id: I8a645d9fee6ce0467ff0b5d1d62531b7c6272aab
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This partially reverts 5764f5e6ea and
fixes the problem differently.
After this commit, "file:///foo" is still equal to "file:/foo", but
"foo:///foo" becomes different from "foo:/foo", as it should be.
Task-number: QTBUG-36151
Change-Id: Ia38638b0f30a7dcf110aa89aa427254c007fc107
Reviewed-by: David Faure <david.faure@kdab.com>
The drawing code currently only optimizes the bilinear interpolation
under specific conditions that allows the optimizations used there.
The patch adds a SSE2 version of the fallback 4 pixel interpolation.
Change-Id: I4e8a2ba6cb44647105a9b24e38b3ab755a435050
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
In case the QPlatformTheme does not provide a QPlatformMenu the
QPlatformSystemTrayIcon is not able to forward the menu because the
QPlatformMenu pointer passed to updateMenu is always null. Providing a
QPlatformMenu in the QPlatformTheme implementation should not be a
requirement for having the menu in the system tray icon. There are
cases where no QPlatformMenu should be created by the theme, e.g. if
the X11 implementation of QSystemTrayIcon gets provided by the xcb
plugin.
The change adds a virtual method to QPlatformSystemTrayIcon to create
a QPlatformMenu. This method is called from the QPA implementation of
QSystemTrayIcon if the QMenu's platformMenu is not present. Thus the
system tray icon is able to provide a custom implementation of the
menu. This gets installed through a new internal method in QMenu to set
the platform menu. It creates the required connections and sync the
state to the QMenu to the newly created QPlatformMenu.
Last but not least QPlatformMenu is extended by a method to create a
QPlatformMenuItem. The default implementation delegates to the platform
theme. This allows to provide the menu item implementation for the
system tray icon without providing the QPlatformMenuItem through the
platform theme.
Change-Id: I17234bd8bcf8c05f8bd786feff0cf8f860430e82
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The setting of the default format of Raster_A8 was mistakenly
moved down to below the override of Raster_RGBMask.
Change-Id: I52ee19180471c6f5c8d6824ee35f8d39632c9d94
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This fixes regression introduced in f864bdaf59
(in resolveAdditionalFormats(), formatIndex(si) returned an invalid
block format index due to non-empty specialData->resolvedFormats)
Task-number: QTBUG-36759
Change-Id: I4da13d2edaf1987bcd85b2ef326e9d22345eb8f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Turns out that \obsolete means "Qt3Support", while the correct tag
is \deprecated.
Change-Id: Id9896893f3078a0d516bd8751bce0b2df441509d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
0x80000000 is too big for a signed 32-bit int, so the compiler ends
up choosing a 64-bit number. Then it will not be the same size as
the parallel enum QDialogButtonBox::ButtonRole, which does not have
these extra flags. By making EOL be the same as InvalidRole and
changing Reverse to 0x40000000, we don't need to use 0x80000000 at
all, so again the compiler can choose a 32-bit representation
for both if appropriate. EOL is used as a terminator in the
static const int buttonRoleLayouts table and therefore as a terminator
in arrays returned from QPlatformDialogHelper::buttonLayout().
It's internal API so it's OK to change in a minor release, but
QtQuick.Dialogs is also looking for the EOL now, so we should avoid
changing it again if possible. This is mainly for efficiency and
for avoiding surprise data type conversions when casting from one
enum to the other.
Change-Id: Ia7b7ce43c8f929d09dd999769e9b7114f695e9a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the focus changes, screen sends a focus deactivated change for the focus window.
Depending on the order, this might deactivate the window focus completely. This
for example leads to problems with QComboBox.
Change-Id: Ia57f061a765c1f971d86d941b17f573ce9221ae1
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
The navigator swipe down event is not mapped to a platform panel event any more.
Instead the NavigatorEventHandler is exposed through the QPlatformNativeInterface.
Change-Id: I6d29bba011849da5210f6f4d595e3c2e0c021449
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Modern websites use around 15 hosts on average so the limit of 5 DNS
looks meant that most non-trivial sites have to wait for at least one
unneeded round trip.
Task-number: QTBUG-30866
Change-Id: I584dd46c247e0413b2ed88dd66f111cff08ff987
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The index is only helpful if the version of GDB to
create it uses the same version as the GDB version
that consumes it. Outside the "local development"
scenario this happens only by conincidence, still
we add ~3.6% to the debug library size and face
maintenance issues like QTBUG-34950.
We also don't see the same performance benefit anymore
with recent versions as we did when the feature was
added, so it's best to not create the index anymore.
People who need it, still can add it manually, or
by the 'gdb-add-index' tool that comes with recent
versions of GDB, or trust their distributors to
set up indexes matching their runtime environment.
Task-number: QTBUG-34950
Change-Id: Id4c79fa51fea9622b0891bd9b9b395b948ecb157
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Implemented the use of the new QDnsLookup property "nameserver".
On the Linux platform, we can specify both IPv4 and IPv6 addresses
for the nameserver.
On Windows since we are using DnsQuery_W(), which does not have a
way of accepting IPv6 addresses, passing IPv6 nameserver address
is not supported.
On OSX/BSD platforms, specifying IPv6 addresses for nameserver
require access to the __res_state_ext structure which is in a
private header of libresolv (this header is different for BSDs and
OSX). If this feature has to be enabled in the future, we have to
figure out a way to access this struct by either accessing the
private header or by specifying one of our own. Currently, I'm
disabling it till such a solution is arrived at.
Nameserver support on different platforms:
Platform | IPv4 | IPv6
-------------+---------------+---------------
Linux/X11 | supported | supported
-------------+---------------+---------------
Windows | supported | not supported
-------------+---------------+---------------
OSX | supported | not supported
-------------+---------------+---------------
WinRT | not supported | not supported
-------------+---------------+---------------
Others | supported | not supported
| (not tested) |
-------------+---------------+---------------
Task-number: QTBUG-30166
Change-Id: Iedbddf15b9a62738ce4c2cfa0fce051514d64766
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes the issue that the blitter required sometimes the
texture wrapping to be repeat
Change-Id: I86150d008422facf9040873b0983b0e44be9ad24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The Origin for Target rect was deemed a confusing concept. The current
implementation would translate the target rect to the coordinate system
specified. However, the order and "direction" of the vertices would
always be the same. So drawing a texture in for one target rect defined in
one coordinate system would paint the texture the same way as it would
when a texture was drawn for a target rect drawn in the "opposite"
coordinate system. The point with this was that if you wanted to "flip"
the texture you would specify that with the source coordinate system.
However, this approach breaks on different levels, such as QRect has functions
which expects a top left coordinate system (ie. top() and bottom()).
In the end Qt uses a top left coordinate system, hence QWindow specifies
a top left coordinate system, and hence the api becomes easier if it is
not possible to define the coordinate system of the target viewport.
Change-Id: I7dd59b3718380876e87a4bff88381d7a1c7d58c1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This also has the advantage of not requiring the use of the locale
codec. Quite an advantage if you're debugging the locale codec. But it's
mostly so that we don't get question marks that hide the difference we
were trying to locate.
[ChangeLog][QtTest] QtTest now prints an escaped version of QStrings
that failed to compare with QCOMPARE. That is, instead of converting
non-printable characters to question marks, QtTest will print the
Unicode representation of the character in question.
Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[ChangeLog][QtCore][Atomic support]Added more operations to the atomic
classes, including operator T(), operator=(T), operator++,
operator--. For the QAtomicInteger, bit-manipulation operations are
also provided, both in operator and in fetchAndXxxYyyyyy modes.
Change-Id: I39c07be74e15e0a48f9e931f4342b182004dee1a
Reviewed-by: David Faure <david.faure@kdab.com>
This is extremely useful, since the most common action after a failed
compare-and-swap is to loop around, trying again with the current
value as found in memory.
Code currently written as:
do {
Type value = atomic.load();
...
} while (!atomic.testAndSetRelaxed(value, desired));
Becomes:
Type value = atomic.load();
do {
...
} while (!atomic.testAndSetRelaxed(value, desired, value));
In most CPU architectures, the value that was found in memory is known
to the compare-and-swap code, so this is more efficient than the
previous code. In architectures where the value is not known, the new
code is no worse than before.
The implementation sometimes modified an existing function, sometimes
it added a new one, depending on whether more registers were needed in
the assembly (like ARMv6-7), the code became more complex (ARMv5), the
optimizer failed (C++11), or it was just plain equivalent (MIPS).
Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ICC 8 and 9 are positively ancient. I doubt anyone is using them for
Qt, let alone Qt 5. ICC 11 through 13 haven't supported OS X.
ICC now masquerades as Clang, so we need to let qmake and
qcompilerdetection.h know about it.
Change-Id: If0d2bd8b6a4a45250c15c9472c062effc76f17de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Apparently it doesn't like the text.
Change-Id: If8e14df84f0d9915018eac94df16bf1b679155e0
Reviewed-by: Keith Gardner <kreios4004@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QByteArray version was missing the overflow check that the other
versions had.
Change-Id: I03cd92e5e5a84c038bee1f1ee217e93e9d9a675a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This implementation is based on GCC's implementation of std::hash<FP>, but only
to the extent of checking for zero before hashing the bits. The bit hasher is
the Qt one; I didn't even look what GCC uses.
The check against 0.0 is mandated by the requirement to have
\forall x,y: x == y => qHash(x) == qHash(y)
which would be violated for x = 0.0 and y = -0.0 if we only hashed the bits.
Implemented out-of-line to avoid potential FP-comparison warnings, as well
as to be able to use the file-static hash() functions, which gets inlined
unlike qHashBits(), which cannot be.
[ChangeLog][QtCore][QHash/QSet] Allowed to use float, double and long double
as QHash/QSet keys.
Change-Id: I38cec4afb860f17e9f8be7b67544e58b330f8fff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>