[ChangeLog][Important Behavior Changes] qmake now enables C++11 support
by default if the compiler is known to support it (unless the compiler
defaults to C++14 or a later edition). To disable this, add to your .pro
file: CONFIG -= c++11. Note that Qt 5.7 will require C++11 support, so
it is a good idea to ensure your code works with that compiler
setting. (Note: it is not possible to disable C++11 support with
Microsoft Visual Studio)
Change-Id: Ib056b47dde3341ef9a52ffff13ef13ee2cf888eb
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This will allow application main to go out of scope and free objects
allocated there.
Change-Id: I7b7199ecf67afe578bac043f16b064c9daaae04a
Task-Id: QTBUG-48760
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
The other left shifts in this file already have the Q_UINT64_C wrapper.
This one was missed.
Change-Id: I42e7ef1a481840699a8dffff140d758ac370c402
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Instead of filling a QString with the padding characters, use a
QVarLengthArray. Do this only in the code path where it's actually
needed, and mark that code path as unlikely.
Change-Id: I11e04ccc4a07e16e430f2ea6dbb2f0f736908f5b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/tools/bootstrap was already compiled with QT_USE_STRINGBUILDER,
by way of load(qt_module), but the actual apps weren't.
Some apps become smaller, some larger; all (presumably) faster.
Change-Id: Idc8662e62ec14b27e730de9842bec295a1b5566e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We should even cause syncqt to exit, but that would cause developers
trying to test something to be unable to. So leave it just with an
"ERROR" message. That is hopefully enough.
Change-Id: Ib056b47dde3341ef9a52ffff13ef5f8588b62b99
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
If you used the QString constructor overload and passed an empty
address, the d pointer would remain uninitialized.
Found by Coverity, CID 11724.
Change-Id: I42e7ef1a481840699a8dffff1407ead3ee703d6e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
I can't find any use, ever, of them.
Change-Id: I42e7ef1a481840699a8dffff1407eb1a93b128a8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
We set it to the number of types that the call expects to receive, but
we never used it anywhere else.
Change-Id: I42e7ef1a481840699a8dffff1407eb520b5844d8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
These events are needed to enable the usage of all input methods available
on Android e.g. gamepads, stylus, etc.
In orer to get GenericMotionEvents your application min API version must
be at least 12, otherwise the application will receive only key events.
Change-Id: I7564fccaf5423aa318ba4f62317eaf101ba6e97e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Android doesn't automatically trigger global objects destruction, so we need to do it ourselves.
Test case:
struct TestGlobal {
~TestGlobal() { qDebug() << " ~TestGlobal";}
} global;
int main() {
return 0;
}
Change-Id: I32507c1cffebafc9841e9707a8f6711dcbd36281
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Dump_QShortcutMap is already made available in qshortcutmap_p.h, and if
set, "void dumpMap() const;" will be available to help debugging.
But unless QDebug &operator<< in qshortcutmap.cpp is also defined, the
dumpMap output will be pretty useless.
Change-Id: If8d535998ec01686eca25da73c2220062820a927
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Prevent QPointer creation for every new target, and a copy of a QVector
of QPointer, and two QPointer destructions, when setting new target
states. The typical (only?) use-case, setting the target states right
after transition creation, is also faster.
Change-Id: I931783afbcea43c8a84200133f26454a4b689edc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
When a delayed event is queued, the state-machine is responsible for
deleting it. Normal flow will ensure that: after the timer fires, the
delayed event is handled normally, which includes deletion. However,
when a timer cannot be set, the event was leaked. But more important: if
there were unhandled (delayed) events when the state-machine was
destoryed, the events were never deleted.
Change-Id: I7d8a6b572765dc1551ddbdebb446aaa3258680c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
- Don't store "\\" as a QString just for passing it to QString:.startsWith()
and prepend(). Keep it a QLatin1String.
-> one allocation less
- Don't use said QString as a flag, use a bool
- Don't store QDir::separator() in a QString
-> one allocation less
-> two indexing operations less
- Don't retrieve QDir::separator() from said QString as QString(sep[0])
-> one more allocation less
- Don't look for a QChar in a string by using QRegExp; use the QChar
overload instead
-> one more allocation (at _least_) less
- Don't convert QDir::separator() with QDir::fromNativeSeparators(); it will
_always_ be '/'...
-> one expensive function call less
-> two QString allocations less
-> one QString(QChar) introduced
-> one allocation more
-> could be removed with QStringLiteral/QString::fromLatin1Char()
Change-Id: I802e66685a95b08cfc557defc63e5f16a7e6306b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It's easier to parse than qglobal.h. The objective is actually to have
macros with parts of the version number, so the major or minor numbers
could be used in other preprocessor macros.
Change-Id: I42e7ef1a481840699a8dffff1404eda1dd5c308d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Otherwise transparent areas of the drag'n'drop pixmap are painted
with the black color.
Task-number: QTBUG-45193
Change-Id: I55b7c7caababe13584fa1c7a52835f112e20f920
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
the library inside a bundle doesn't have an extension.
this doesn't really fix anything except suppressing the error message,
as we discard the result of the operation anyway.
Change-Id: Idfe3d1714dedb59d9d3e86a65f074e516c431389
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Release the DC and move alpha-checking into separate function
to prevent it from using invalid width/height.
Task-number: QTBUG-48732
Change-Id: Iaf7cfa89b0f702f5012b0451d24a9e887d832c59
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
at least the mingw version we use now interprets the sequence \# as a
literal hashmark, which completely defeats the previous hack.
the new hack escapes the backslash with another backslash, which appears
to work. however, make does *not* remove the additional backslash, so
the result is a bit ugly.
Change-Id: I591a2be443880b162094d04e5a5e624216b59311
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
We initialize the variable d at the top using Q_D(const QWindow);
Change-Id: I2de3b33c043024c5599b7cd1ebecae2db0b39d87
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Application that do not require OpenGL need a way to opt-out of
GLX/EGL calls completely. The initialization can be expensive and what
is more, some systems may not have functional GLX at all (some VMs are
known to crash when trying to get FBConfigs for the window).
QApplication already has AA_ForceRasterWidgets, which causes the use
of plain RasterSurface everywhere instead of RasterGLSurface. Combined
with a trivial check in the xcb backend to skip all the Xlib+GLX/EGL
path, the attribute will allow apps to ensure that no GLX/EGL calls
are ever made.
This however implies a change in QWindowContainer: the embedded window
must use the same initialization path as the parent otherwise we will
end up with a BadMatch. QWindowContainer can do this transparently to
the applications, unless the QWindow is already created.
Change-Id: I846af7edb8b92b9836cdbd93c6a5eec5a6147a49
Task-number: QTBUG-46765
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
The default backingstore implementation is now cleaned for ES_2 ifdefs.
All the checks are now done at runtime and ES 3.0+ is included as well
for the efficient, QImage::copy()-less path.
For embedded a customized backingstore is used so the change has to be
done separately there.
This should result in a slight improvement for QOpenGLWidget/QQuickWidget
when running on GLES 3.x.
Task-number: QTBUG-37624
Change-Id: I107330c25a993c5cdcd92e4ebdc17ae172a03da8
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
the windows driver for Intel HD Graphics 3000 is buggy (crashes on
initialization) and according to intel, this driver won't receive any
bugfixes. device IDs taken from
http://www.pcidatabase.com/search.php?device_search_str=graphics
Task-number: QTBUG-42240
Change-Id: Ib846d37f67d901060d1318f3f211a5e5dc4f6814
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
KMS is no longer a platform plugin so the relevant leftover bits are
now removed.
As the introduction of the EGLDevice-based backend for eglfs shows,
using DRM/KMS is not tied to GBM, separate buffer management
approaches, like EGLStreams, work fine as well. Therefore separate KMS
from GBM and remove the EGL and GLES dependency in the tests - this
way there is nothing preventing us from using GBM without GL for
example.
Change-Id: Id7ebe172b44b315f9a637892237d2bb62d99aed2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
For now we pick one crtc and find the corresponding layer. If this is
not desired, set QT_QPA_EGLFS_LAYER_INDEX to override the layer to be
used. Enable qt.qpa.eglfs.kms to get logs about the available layers.
Change-Id: I762783f960739e32966c8cde17d8f55fbe40091f
Done-with: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Backends may want to subclass QEglFSWindow and reimplement resetSurface()
and similar. Make it possible to do this by moving window creation to
the device integration interface, similarly to screens.
In addition to customizing the windows, some backends may want to disable
the dependency on surfaceless contexts when using offscreen windows
(i.e. pbuffer surfaces). Make this possible too.
Change-Id: Ic5a426e07f821c7a800217b8799f91770ba6a6d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
In anticipation of moving it to QtCore.
The call to QWindowSystemInterface::sendWindowSystemEvents() has been
moved to QIOSEventDispatcher by making processPostedEvents() virtual.
Change-Id: I9e03be4153a9f5f34e9a0ac942cdff572a44c318
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Now all Qt sequential containers consistently provide reverse iterators.
The associative ones, by way of not returning std::pair from op*, can't
just use std::reverse_iterator. They would miss .key() and .value() methods.
So that has to wait for 5.7.
The reverse versions of the new key_iterators can also just use
std::reverse_iterator, but I'm afraid that after bikeshedding over
keyRBegin() vs. rKeyBegin() vs. reverseKeyBegin() vs. rkbegin()
vs. krbegin() (<-- of course, what else?), it would anyway be too
late for 5.6, so defer, too.
[ChangeLog][QtCore][QLinkedList/QSet] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.
Task-number: QTBUG-25919
Change-Id: I58316fffade469e9a42c61d7aa1455ae3443fd94
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
A QAbstractSocket can be close()'d at any time, independently of its
current connection state. being closed means that we cannot use it to
read or write data, but internally it might still have some data to
send or receive, for example to an http server. We can even get a
connected() signal after close()'ing the socket.
We need to catch this condition and mark any pending data not yet
written to the socket for resending.
Task-number: QTBUG-48326
Change-Id: I6f61c35f2c567f2a138f8cfe9ade7fd1ec039be6
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Previously, only QXmlTestLogger had timers to take elapsed times
and log them. Move those into class QTestLog for access by
the loggers and output the times in the crash dump to make it
easier to spot hangs/recursion crashes.
Produces:
QFATAL : foo() Received signal 11
Function time: 22ms Total time: 23ms
A crash occurred in ...
Function time: 24ms Total time: 26ms
Task-number: QTBUG-47370
Change-Id: Ia530a63104087daffc9a15f68c15d93378b9407e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This is a continuation of the work started in commit
694d300355.
Attach reference ('&') and pointer ('*') qualifiers to the
parameter name, as per Qt coding style.
Previously, function signatures were documented like this:
QString & QString::append(const QString & str)
After this change, they will appear like this:
QString &QString::append(const QString &str)
Change-Id: Ie103fc2929635bc32145e50469c600f9f378f97c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
QDoc wrote \target and \keyword information into the index file
properly, but did not read them back in.
This was because the code for handling enum and function elements
read their own child elements (without handling targets), and
marked the remaining children to be skipped.
This commit fixes the issue by refactoring the code for inserting
targets into a new function and calling it from relevant places.
Change-Id: I85d7b26ce54620daec35b19e447d1a065515b863
Task-number: QTBUG-48687
Reviewed-by: Martin Smith <martin.smith@digia.com>
The message box buttons need to be added inside the XAML thread.
Otherwise QWinRTMessageDialogHelper::onCompleted will not be triggered.
To successfully emit the clicked signal across different threads do not
exit the eventloop.
Change-Id: Ie884bdfe0dc64132559755083dae50c2aa43d80b
Task-number: QTBUG-48209
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Don't use gst_is_initialized(). It was added in 0.10.31, but we don't
actually require that version.
Change-Id: If5d662e18511cf636861bf93eeccc1f5b69e26f1
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
After calling connectToHost(), the socket enters HostLookup state. At this
stage, the socket engine was not created yet, and writing to the socket
should result in either data buffering or an error. So, add a check for
d->socketEngine to prevent a crash on unbuffered sockets.
Task-number: QTBUG-48356
Change-Id: I15ea9ce7de97ce6d7e13e358eca5350745b556bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
On OS X we don't treat popup windows as worthy of being activated and
focus windows (key windows). Instead we keep track of the active popup
windows and forward events to them manually.
The forwarding logic is split between QPA, which handles mouse, and
QWidgetWindow and QQuickWindowPrivate, which handles key events.
This commit adds the logic for key events to QPA, which is the right
platform layer for this kind of workarounds. The widget code is left
as is for now, and the QQuickWindowPrivate code can be removed in
a follow up.
Task-number: QTBUG-39415
Change-Id: Iee411fcba9fc81ddcc3a7bc82591184675a6d7a2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
If QTimer::singleShot() is used with a functor callback and a context
object with different thread affinity than the caller, a crash can
occur. If the context object's thread is scheduled before
connecting to QCoreApplication::aboutToQuit(), the timer has a change
to fire and QSingleShotTimer::timerEvent() will delete the
QSingleShotTimer object making the this pointer used in the
connection invalid. This can occur relatively often if an interval
of 0 is used.
Making the moveToThread() call the last thing in the constructor
ensures that the constructor gets to run to completion before the
timer has a chance to fire.
Task-number: QTBUG-48700
Change-Id: Iab73d02933635821b8d1ca1ff3d53e92eca85834
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>