The platform is no longer supported or actively maintained, and is
in the way for improvements to the Unix event dispatcher and QProcess
implementations.
Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
If, after checking a condition, we issue a qWarning(),
by definition that check is unlikely to be true.
Tell the compiler so it can move the error handling
code out of the normal code path to increase the
effective icache size.
This change contains the changes to the util/,
dialogs/ and widgets/ subdirs.
Moved conditional code around where possible so that
we could always use Q_UNLIKELY, instead of having to
revert to Q_LIKELY here and there.
In QSystemTrayIcon::setVisible(), as a drive-by, I
swapped the evaluation order of an &&-expression
(newly wrapped in Q_UNLIKELY) to be more readable
and more efficient (cheaper check first) at the same
time.
Change-Id: I3564c5a5deacba49d67d3989fb0b53e680c57fcb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is more efficient and works even with non-US-ASCII
QStrings.
Change-Id: I4ca19de60347ded03022ef8540a6708c563bc9d7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QString::asprintf() has the ability to take a ushort* array as
obtained from QString::utf16() and insert that into the output
with an %ls conversion.
But no-one ever used this, because just passing QString::utf16()
to QString::asprintf() creates a warning about wchar_t* expected,
but ushort* provided.
The new qUtf16Printable() macro adds the necessary casts (via void*
to prevent any "type-punned pointer" warnings) to make
passing QString::utf16() to QString::asprintf() work silently.
This should greatly reduce the need to do a round-trip via utf-8
just to print the contents of a QString.
[ChangeLog][QtCore] Added qUtf16Printable().
Change-Id: I7ddd8d2b2a2191c9faa26aca95d49850d94b287c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This should solve problems with our use of the noexcept
operator, because that's how std::pair is defined, too.
Mid-term, we should kill QPair and use std::pair instead.
It really has gotten way too complicated to implement a
C++11 pair correctly.
Task-number: QTBUG-48780
Change-Id: Ied0acd220e5131000a957dc356d6efcdd8f83828
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... at the cost of a bunch of warnings about
ushort*/wchar_t*.
It wasn't checked at all, which isn't really a solution,
either.
Split off the %s checks into a separate function, which
makes obvious the sorry state of sprintf non-%s, non-%d
testing that's left.
Change-Id: I6312f984bacfb568b609e34b5218b3ab9a9765c4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We don't support that compiler anymore.
Change-Id: I6d100a2d149ce4e506c7f8be3b56a33fa9d7092f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
In C++, signed overflow math is Undefined Behavior. However, many CPUs
do implement some way to check for overflow. Some compilers expose
intrinsics to use this functionality. If the no intrinsic is exposed,
overflow checking can be done by widening the result type and "manually"
checking for overflow. Or, for X86, by using inline assembly to use the
CPU features.
Used in QtQml.
Change-Id: I2ef2523ccaa98f6757a45e24862a2fa730a26bb0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QPixmapStyle class provides a mechanism for implementing pixmap based
QStyles, using the same concept introduced by the BorderImage QML component.
The bb10style plugin in qtstyleplugins uses this class and is currently the
only user.
Change-Id: Ibfa2104e95ba6a91e89a6277baa97a7fc9edaec2
Done-with: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
We know that the QAbstractSocketPrivate::canReadNotification() slot is
called by the engine's read notifier only when new data is available for
reading, or when the socket has been closed. This allows us to remove
additional checks for engine validity and data availability for unbuffered
sockets.
Change-Id: Ic278cf2214d418d8fe471ea24a765b8d5840b0a5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Insert a section symbol (U+00A7) to the end of a text flow instead of a
space as many text layout applications do.
Task-number: QTBUG-49252
Change-Id: Ib1276b508c24824b6329e0458ae5171bc1a288c3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Two QObjects had no parent. This caused memory leaks on app close.
Confirmed with the valgrind memory analyzer tool from Qt Creator.
Change-Id: I9294099ca819be1a9c5b74b3cec5bf197be06433
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... by using the new QUtf8::convertToUnicode() function in
conjunction with QString::resize().
For this to be a clear optimization, resize() must be banned
from shrinking capacity, which another patch will implement.
Change-Id: I6394af95ef1aaae131e23a4227734eb76fa685cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
... and therefore doesn't need to allocate and thus
can be marked as nothrow.
Technically, the function doesn't have a wide
contract, because it has the precondition that
the buffer pointed to by the first argument needs
to be large enough to hold the result.
But that precondition can't be checked from within
the function, so no failure can be generated for
it and thus the nothrow guarantee is acceptable
(and desireable).
Change-Id: Iaf6ea6788ef6b4bbb6d8de59a3d0b14d66582307
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Port parse_field_width from constructing a QString and
then calling toInt() on it to use qstrtoull().
Not only do we not allocate memory anymore, we even
don't need to copy the digits out of the format
string - qstrtoull() does it all for us.
In order to preserve behavior with the previous code,
which consumed all digits before performing error
checking on them, we also consume all digits, even if
qstrtoull() would have returned the start of the range
as the end pointer.
Change-Id: Ief941ce3a8ea43d2e5475d9eab77d7d0d7abc450
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
... and reuse the function to parse precision, too.
This also allows to more easily simplify it (done in a
follow-up commit).
Change-Id: I9da27c4b06565f676e15ef9cab7c53b5d464515e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
... and simplify the method afterwards:
Drop the boolean that was used to control program
flow when the code was still part of vasprintf(),
by taking advantage of the fact that we can now
just return from the function to break out of both
the switch and the loop.
Change-Id: I97f050b63c0c309aaed3cb0fe979d53c8d970003
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Qt already assumes a working IEEE-754 implementation, so we can rely
on a working std::numeric_limits<double>.
This patch also gets rid of three cases of type-punning with unions
(which is undefined behavior in C++).
Change-Id: Ic3747f49d55e372960abf2091c1d5752c1eccdff
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For some reason add_ConnectionReceived has to be
called on the Xaml thread now. Otherwise the callback
function won't be called and thus listening on a TCP
socket won't work at all.
Task-number: QTBUG-49121
Change-Id: I11ce2f72b0c1d3bb20e9579de5a2ce5150ca966a
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Calling QWinRTScreen::onOrientationChanged in the class constructor
can lead to situation where QWinRTScreen is expected to be fully
constructed. Moving the onOrientationChanged call to
QWinRTScreen::initialize ensures that QWinRTScreen is fully
constructed when it is called.
Task-Id: QTBUG-49470
Change-Id: I52748f33a9011dec3a172c1a74023cad15aae38a
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
This brings MSVC 2015 support to almost C++11 feature completion.
Constexpr support still has one annoying bug, for which the fix is
promised for Update 2.
Change-Id: I92c2ee6638625c61e3a16690563434e32d853368
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The ffsll function is missing with that SDK, but Clang and GCC support
it as the builtin.
Change-Id: I9f4d900898814b569c1affff140e15fb59fb45d8
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
When that happens, we need to detach (in-place conversion won't work),
so we recurse back into the same function, but the template version that
does detaching.
Task-number: QTBUG-49181
Change-Id: Idba8c29717f34c70a58fffff1412fea3acc95f98
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
frameworks are currently broken anyway, and we don't create .pc files
for the private part of public modules, so creating them for entirely
private modules is just inconsistent.
Change-Id: I98da8def73d72ac69b9b246687dce6b1fd150f61
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
the projects which use full mode with the named modules have them.
Change-Id: I3b9383d1cc2b43411c25690a5e35e7e84a55aa23
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
the check whether a module depends on itself should be done by the code
which *builds* modules, not which *uses* them.
the check whether a plugin tries to use itself seems kinda pointless in
the first place, so just remove it.
Change-Id: I89b357dae7d7979d131b6824f197e7088047272f
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
that way other modules can use the headers without hacks.
this required making the base directory for paths in headers.pri
configurable in syncqt.
Change-Id: Id35cfe05bcf4c576d3f2d0d8d09590a5e23d21d3
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
there is nothing to link with it anyway.
Change-Id: I2e942d24bb39855b3682f3e8d85cb6abca75cb61
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
instead of building host tools always in debug mode, follow the overall
build type, and provide an option to override it.
this supersedes the pre-existing -optimized-qmake option.
however, that option never existed in the windows configure, and this
legacy continues as far as qmake is concerned (msvc builds of qmake are
always somewhat optimized, but not mingw builds).
Change-Id: I42e7ef1a481840699a8dffff13fec2626af19cc6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit allows to avoid superfluous calls to the X server.
We don't request _NET_WORKAREA values when the screen geometry changes,
and we avoid RandR calls on each _NET_WORKAREA change.
Besides, update the available geometry of all screens with the
same root window, rather than only that one which corresponds
to Qt::Desktop window.
Change-Id: I5ec624717f5f261c986cd9aaf2425f22985e11c0
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This makes the automatic center click feature of the mouse event methods
also work if the target window isn't positioned at 0,0.
Change-Id: I0d711e484620900ba2ffc4139f7e13346a7482d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The native position is given in device-independent pixels, so multiply
that by the window scale factor. If no cursor is present (e.g. on
Windows Phone), the native API returns SHRT_MIN as the coordinate values.
Catch that and pass Infinity instead in order to enable the cursorless
fall-back behavior in QQuickMenu::popup().
Change-Id: Ibe8ebcdbe257e8df25eea9873e8f4fa647ae1ab2
Task-Id: QTBUG-48265
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Extend the current BLACKLIST to cover all all Windows versions
and add watchFileAndItsDirectory:native backend-testfile.
Task-number: QTBUG-30943
Change-Id: Ic58c090f23d3584843bc1e74eba533d75c530ad3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
That is the new name for gnome-icon-theme for more than 1.5 years. See [1]
for details.
Still keep “gnome” as the fallback icon theme, so this commit should not
break anything.
[1]: https://mail.gnome.org/archives/desktop-devel-list/2014-April/msg00086.html
Change-Id: Ifc2178827ad2cf6fdbc4e5248c83789ebc5b797e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
QWinRTInputContext is created from the XAML Thread, which can cause
problems when handleVisibilityChange is invoked. Instead just query the
keyboardRect and skip the emit.
Task-number: QTBUG-49389
Change-Id: I158204a07b9e000adffdc308e68b0f1425ed7c62
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
decltype is mandatory now so we can remove the implementations
of Q_FOREACH that are not using decltype
Change-Id: If42a7fb078230ee7bdb55a9442125d7af70913e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In order to know the type of the arguments of a functor with compilers
not having decltype, it was simulated with an intermediary function.
Now that decltype is mandatory, we can remove this hack
Change-Id: I7eb283943abeeb4ef1c62358da89b0ede70b3ef5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>