In 50bf54c invoking windeployqt was only required in release mode as
MDILXapCompile was not invoked for debug builds with Visual Studio 2013.
However, Visual Studio 2015 invokes MDILXapCompile for debug and
release. Hence we have to use this workaround unconditionally.
Also we cannot limit this to msvc2015 host specs only, as older projects
still might be loaded with Visual Studio 2015 causing the build to
break.
Task-number: QTBUG-49815
Change-Id: Ia120a392967319b945a9746ad489f2db0eed7156
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Windows 10 requires apps to handle the PrelaunchActivated property. This
enables a faster startup by launching an app and immediately suspending
it. This happens by the system and at the time the user launches the app
no library loading or initialization is required.
By default we opt-out of this and return early. The reason is that we
cannot know the type of application written in Qt and whether it breaks
the guidelines by using prelaunch. For further details check here:
https://msdn.microsoft.com/en-us/library/windows/apps/mt593297.aspx
Task-number: QTBUG-50292
Change-Id: I4d0b0b95a03f93b99211d042895404a88ea7cb9d
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
qstrtod() used to accept trailing junk until libdouble-conversion was
introduced and we need this behavior in order to implement EcmaScript's
parseFloat() correctly. The QString and QByteArray methods should not
accept trailing junk, though.
Task-number: QTBUG-50131
Change-Id: Ide922da0d65b2576be2c9f47f6053057eff77994
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
- Use perfect forwarding for the additional argument.
- Provide a variadic template version
- Deprecate qLoadPlugin1() — there's no reason for a different name
— and fix all callers in qtbase.
- Provide non-variadic overloads for up to three additional args
(QPlatformIntegration rolled its own function because it needs
three args).
Change-Id: I72fb2dd9a021de704cbf5e4b6ea31c80447fb3b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The use of QPair made the return type of initializeAnimation()
so complicated, that the original author opted to declare the
pair on one line, then assign to it in the next, to keep below
the line length limit.
She also copied a member of the pair just so as to give it a
descriptive name.
Fix both by introducing a small result struct. It has a nicer
name, compared to the pair, but still port callers to use 'auto'.
The member names are descriptive enough now.
Saves more than 0.5KiB in text size on optimized GCC 4.9 Linux
AMD64 builds, too.
Change-Id: I7ed007ffa0fb16e182e38cd405cfd54da4e363fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Instead of using a "custom wait function" in cases,
where a timeout is needed (like in qhostinfo_winrt.cpp)
we should have the timeout as part of our await
function.
By having one common place to handle this, we can avoid
unnecessary warnings, that might be caused by custom
functions. The current implementation in qhostinfo
for example causes at least 1 "originate error"
exception per call.
Change-Id: I7b6cfdfd861af2b0d271465eecaefe4a93e3109b
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
By using await instead of using a custom wait function we
get rid of a lot of "function was called at an unexpected
time" warnings and use the default way of waiting for an
asynchronous function to complete.
Change-Id: I6c5bf73ccf68a219b8f3facd3531873d7e8d4c67
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
That API has been available for WinRT and Windows
Phone for some time now. By using it to get the
machine name and for hostname resolution we can get
rid of some winrt-only code and use qhostinfo_win.cpp
on WinRT and Windows phone as well.
Additionally the required capability was added to
tst_qhostinfo so that this auto test can be run without
any manual editing.
Change-Id: I63fa5521bf8cdb0c919bd5a0100ea977c865622a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Windows Phone 8.1 provides access to the camera button and press/release
events get passed as Key_CameraFocus and Key_Camera. Unfortunately a
release does not provide what has been pressed before, hence this
information needs to be cached when the press happens.
Done-with: Maurice Kalinowski<maurice.kalinowski@theqtcompany.com>
Task-number: QTBUG-39115
Change-Id: I6ce58a1f07a6bf7183b8d99a26e5cd7b0d32d6db
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
This test seems to be quite broken on OS X: qWaitForWindowExposed returns
too early (while no window is on screen) so gestures can not be dispatched
QApplication::topLevelAt(pt) - returns null.
Use qWait + isExposed combo instead (similar to qWaitForWindowExposed, but
there is no isExposed test before the loop).
Change-Id: I85fbd773ccce0ca92b2dceb1749d67ef767aa0cf
Task-number: QTBUG-49849
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
_panTimer has a target - for example, widget. 'reset' should stop this timer.
The problem (quite subtle and difficult to reproduce) found in tst_QTouchEvent:
widgets created/destoryed by different tests but we still can have a timer
waiting for event dispatcher to 'processEvents', firing with now-invalid
dangling pointer - 'target'.
Change-Id: Iccaf3368a8ee6a0a2f60e9dcdf5d40fb7392ca21
Task-number: QTBUG-49844
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Saves just under 5.5KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: I6d868a7d2e469cf0564127b0e66cd7b272a0c9cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A QStringList is almost as efficient as a QVector<QString>.
More importantly, the QStringList case can share code with
the myriad of other QStringList users, in particular
because std::stack is but the thinnest of wrappers around
its underlying container.
Saves 1400b in text size on optimized GCC 4.9 Linux AMD64
builds.
Change-Id: If37ed55802aa8a529ca772df465990ded0aaba7f
Reviewed-by: David Faure <david.faure@kdab.com>
... by not re-creating the same string in every loop iteration.
Change-Id: If17c5980bec8276b531267b309578dac8901c93e
Reviewed-by: David Faure <david.faure@kdab.com>
Trying to set data for a compressed cubemap texture face fails, because
the code incorrectly tries to bind to a cubemap face target.
This was already fixed for uncompressed textures. Instead of duplicating
the code, moved the texture binding/unbinding code to a RAII class.
Change-Id: I8f1cb7fc661b919200f85c3465d6e6e3c22d0871
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
When using cipher algorithms with forward secrecy an ephemeral key is
used to generate the symmetric session key. Beside the SSL certificate's
key, this ephemeral key is of cryptographic interest.
The ephemeral key is chosen by the server side - currently statically in
the Qt implementation - so it is only of interest on the client side to
check it. Therefore the ephemeral key is the null key if the connection
is set up in server mode or a cipher without forward secrecy is used.
Change-Id: If241247dbb8490a91233ae47f2b38952c6591bf4
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
QApplication::wheelScrollLines() was always 1 due it being a bool.
Task-number: QTBUG-49561
Change-Id: I83e97da3507c31dfd024db7bf543c4e6a3b4a98b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
The #if had a condition that was needlessly hard to understand;
and was widely separated from its #else clause.
Change-Id: I43f4282993f4f2e8c4b5ad07dc2c2e06a6b95aa9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
There is no need in special OS dependent code now, because the
socket notifiers got the identical behavior on all platforms.
Change-Id: I53ee51cd5eeff328e0b73f7325d2c9e883c5b213
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Qt uses QHash as the container for faking environment variables on
Windows Runtime and CE. Environment variable manipulation functions are
protected by mutex. Accessing the QT_HASH_SEED environment variable
inside QHash can lead to situation where qputenv() call leads to
qgetenv() call and that leads to a deadlock. Change the container
from QHash to QVector to avoid deadlock.
Task-number: QTBUG-49529
Change-Id: I550ead4ab12e7abebc044f52339063a44fcf0170
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
The latter is much faster as it doesn't have to deal with
time zones.
This change is safe because QNetworkHeadersPrivate::fromHttpDate(),
used as the QDateTime source in other, nearby, code paths, also
returns only UTC date-times. So not only is this change faster at
the call site, it also avoids inconsistent-timespec comparisons
down the line.
Credits to Milian Wolff, from whose QtWS15 talk this advice is
taken.
Change-Id: I26d308a2763cc45d28bc96871e651f30b17a6b85
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Saves more than 1KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: I1a974e903bc8352af800fa26edae0194c1e51705
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old code asked each thread to stop, and then waited for
that one thread to finish before deleting it and turning
to the next thread in line.
Split the three actions, ie. first ask all threads to stop,
then wait for all threads to finish, and only then delete
all of them.
Apart from being more icache-friendly, this enables more
concurrency, as stopped threads' cleanup work can overlap
with other's, thus reducing the wait() time per thread to
potentially zero.
Did not replicate the inefficient foreach loop, but went
with C++11 range-fors directly.
Change-Id: I53e598e31999a772c0f81ff5885490216e13d492
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Saves more than 4KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: Ice3fe915622a399d1ed10e0ce364cf54b4b835fe
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Saves a bit over 2.5KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: I18a635d65a3c20c4bf5ec2cbfa4ed81a8153cab3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Saves just shy of 4KiB in text size on optimized GCC 4.9 Linux
AMD64 builds, iow: ~0.07% of the total QtCore library size.
Change-Id: I87fdcc8ee25c6bb5dabddb9a694ab4496b1538fa
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Saves just shy of 6KiB in text size on optimized GCC 4.9 Linux
AMD64 builds, iow: ~0.1% of the total QtCore library size.
Change-Id: I087e1e34a64944affb1211e16371e314012c4b2c
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Not many left. Still 344b saved in text size on optimized
GCC 4.9 Linux AMD64 builds.
Change-Id: I51ba49fe065854f84e26d25d7da5e26427ea2c0b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Saves 327b in text size, but done mainly because such
functions shouldn't be inline in the first place.
Change-Id: Ieea97f13620e4411dc01cb0d390bd668c13cfa7a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
...to turn mutable lvalues into const lvalues.
Like the proposed std::as_const, it should not apply to
rvalues to avoid lifetime issues in code like
for (auto x : qAsConst(someFunc()))
// dangling
At a more basic level, qAsConst isn't useful for rvalues,
because one can always store them in an lvalue first, with
no loss in performance (the object is created by the
compiler silently anyway). So the correct way to write the
above is:
const auto funcResult = someFunc();
for (auto e : funcResult)
To fail compilation when passing rvalues, I used the
const-&& pattern also employed by std::cref(), and the
proposed std::as_const.
Intended as internal API, but not put into the QtPrivate
namespace to make it simpler to use.
We could wait for std::as_const, but that is far, far
away (just entered the current C++17 draft as of this
writing), and the Qt containers with their tendency to
detach are a problem _now_.
Change-Id: I8824a59d2274de5c5cd642f117212322e4648025
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
It makes tst_QMutex::contendedQMutex with no msleep 8 times faster
Change-Id: Ic300e7618b4467e4e08b30f0213bd23c06d4d90a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The 'itemList' is a QList and is not maintained in sorted order.
Change-Id: I8f221281803ff0e9caa054007bee3058214f2f30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old code re-used a QFileInfo object, repeatedly
setting new file names with QFileInfo::setFile(QString).
But QFileInfo::setFile() simply assigns itself a
new QFileInfo object:
*this = QFileInfo(...)
so it's just as efficient to re-create a new QFIleInfo
object for every file name under test.
To avoid extra {} for object lifetime scoping, factor
the repeated evaluation of isReadable() && isFile()
into a small helper function, which also creates and
destroys the QFileInfo object.
The deeper significance of this change is that it
avoids implicit sharing of 'realname', which is
permanently modified. A later patch will make
changes that make 'realname' re-use its capacity
through the lifetime of the find_translation()
function, and sharing the variable implicitly will
nip any auch attempts in the bud.
Force the compiler to not inline the new function.
There's really no point in spending ~0.5KiB in text
size on inlining the code; the miniscule speed
improvement is dwarfed by the memory allocation of
the QFileInfo ctor, anyway.
As a consequence, this change even saves 96b in text
size on optimized GCC 4.9 Linux AMD64 builds, even
though that wasn't even the goal.
Change-Id: I08c5cbb7b6f1ba59440a1597e28d962ce63a7c65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This often happens in applications. Besides, we are expecting at least a
call to RequestName to happen.
Change-Id: Ifd2454ffba454fd591d0ffff1425a84563267d19
Reviewed-by: David Faure <david.faure@kdab.com>
... and remove misleading comments (these are overloads, not specializations).
The QList overloads do nothing different from the generic container
overloads. Remove them.
Only leave the QVariantList overload, because that converts to
QDBusVariant before serializing. Which means that this should
probably be templated on the container type, otherwise you get
different behavior for QList<QVariant> and, say, QVector<QVariant>,
which is surely wrong.
Change-Id: I215ba9891235b51304c2ed4041d3dbd003d69581
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- populate the widget with addItems(QStringList) instead of
looping over addItem(QString)
- Use findText() instead of looping over itemText(int).
QComboBox::findText() delegates searching to the model
(via QAbstractItemModel::match()), so is potentially
much faster. I say potentially, because match() isn't
properly reimplemented in most models, yet. But that is
something to fix in the models.
Change-Id: I6e52cf5af810ab7869c0270504a241868a5ca281
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
To retain a bit compatibility with applications developed in the last 9
years that expect that QDBusConnections won't process their events until
the event loop runs, we now suspend the handling of incoming messages
in the two default buses (and only in them) and resume when the event
loop starts. This is required because the new threaded QtDBus would
otherwise process incoming messages that the application didn't expect
it to.
For example, if the application first acquires names on the bus and only
after that registers objects with QtDBus, there's a small window in
which the name is acquired and visible to other applications, but no
objects are registered yet. Calls to those objects may be received,
would then be processed in the QDBusConnectionManager thread and fail.
The work around is to disable the actual handling of method calls and
signals in QDBusConnectionPrivate::handleMessage. Instead, those
messages are queued until later.
Due to the way that libdbus-1 works, outgoing method calls that are
waiting for replies are not affected, since their processing does not
happen in handleMessage().
[ChangeLog][Important Behavior Changes] QtDBus now uses threads to
implement processing of incoming and outgoing messages. This solves a
number of thread safety issues and fixes an architectural problem that
would cause all processing to stop if a particular thread (usually the
main thread) were blocked in any operation. On the flip side, application
developers need to know that modifications to a QDBusConnection may be
visible immediately on the connection, so they should be done in an
order that won't allow for incomplete states to be observed (for
example, first register all objects, then acquire service names).
Change-Id: I39cc61d0d59846ab8c23ffff1423c6d555f6ee0a
Reviewed-by: David Faure <david.faure@kdab.com>