Iteration over node-based containers is so slow that the number of passes
should be minimized.
Replace QList with QVector. Saves ~0.2 KBytes in text size with gcc 4.9.
Change-Id: I93298b29b06e4a38a6f716d85f127e0af4385461
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Knowing the real virtual keyboard height will be easier for us to
decide if we pan or resize the current view.
The virtual keyboard is re-shown if current virtual keyboard height
is different from previous one.
Task-number: QTBUG-43739
Change-Id: I1bb41a70cced4c1d0e5f05a6c554831459b7a917
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Just cache it.
Also port to QStringLiteral, because the string is never modified.
Since the string literal is used in more than one function, to
avoid duplication of .rodata, wrap the QStringLiteral in an
inline function.
Change-Id: Ib5aede9f129610c80d122939afc343c938cc8e48
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Whenever there are spies installed, we call out to the main thread to
call to the kded/kiod message spies. This allows the spy code to do just
about anything, where previously it was restricted in what it could do
to avoid deadlocking or triggering assertions if it recursed back into
QDBusConnection code in the manager thread. After the spies are done,
the message is re-inserted into the QDBusConnection processing pipeline.
This commit moves the spy handling to after the check for disabled
dispatching, as doing otherwise would mean the message could get
postponed again for no good reason. It's also possible that the main
thread isn't done installing the hooks, so waiting until the dispatching
is enabled is a good idea.
For simplicity, this commit also restricts spying to method calls
only. Signals are no longer spyable.
Change-Id: I3d11545be52c43119f0fffff142b0e9d447415c2
Reviewed-by: David Faure <david.faure@kdab.com>
Commit 5c7f000cd4 greatly reduces the
number of repaints for QOpenGLWidget. Unfortunately, this included when
the widget changes screens.
Change-Id: Iaabcb94925e4519cb5d8561b47aaddcfdc7b01ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
The srcRect is already in device window coordinates. Converting it
again via deviceRect(QRect, QWindow) causes it to be overly large.
Task-number: QTBUG-50613
Change-Id: Iaae390499c0d1add842bde6eec22fb07c8de663b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This allows TeamCity to parse realtime test-results instead of using
post-build XML Report Processing. This does not support logging of
benchmarks.
[ChangeLog][QTest] Added a new logging mode that allow test-results to
be parsed on-the-fly when using Jetbrains TeamCity as CI-server. This
mode is enabled by using the -teamcity option on the command-line.
Change-Id: Ie730beb643043eb0f448f99abe6c0b5ac48aaf03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of creating a QByteArray, possibly normalizing a leading
'--' (one allocation, plus possibly one copy), simply use the
old 'ol str(n)cmp, skipping the first character if the argument
starts with '--'.
It also fixes parsing of -stylesheet and other options which
were erroneously parsed using indexOf() != -1, when they
should have used startsWith().
Also saves 504/742/522b in text size for QtCore/QtGui/QtWidgets,
resp., on optimized GCC 5.3 Linux AMD64 builds.
Change-Id: Ida868badac3fb9b77285417ee537c861ccc4fc06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When resolving the signal/slot of connect(&Foo::bar, ...) we place a meta-call
to map the address to the method index. Once we have found the index, we don't
need to continue but can return the result right away.
Change-Id: I67bb22df394d7c22dc1731367c0961b958ed77b3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-developer-build enables -Werror=undef, which uncovered a bug inside
qcompilerdetection.h.
According to the Dinkum headers, it is necessary to account for three different states
concerning the values of the _HAS_* macros:
1. undefined
2. 0
3. 1
Therefore, it is necessary to check both whether it is defined and if it is
not 0. Only checking whether a given macro is 0 will generate a trap by
-Werror=undef.
(__GLIBCXX__ is the sole exception).
Change-Id: Ib95e485698ee38858a1671d930d7e960b75bb041
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is needed to correctly handle show on non-primary
screens.
Change-Id: I80b13372b3a92786987a66f0da385af6b4a6a863
Task-number: QTBUG-47950
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
QDateTime::toString for Qt::TextDate unconditionally uses the system
locale (because QDate::shortDayName and QDate::shortMonthName do).
Setting the default QLocale has no effect. If you ask me, those two
QDate methods are buggy, but they are documented that way.
Change-Id: I408dcb81ba654c929f25ffff1427366b04da5a43
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both constructors were taking a pointer, so they participated in
overload resolution along with QTextDocument and QTextFrame pointers.
Instead, make them take references and move them to the private section
of QTextCursor. That necessitated adding a method to QTextCursorPrivate
to access that private constructor from non-friend classes.
Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
I wrote a script to help find the files, but I reviewed the
contributions manually to be sure I wasn't claiming copyright for search
& replace, adding Q_DECL_NOTHROW or adding "We mean it" headers.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
QFileInfo::exists(f) is somewhat faster than the version which creates an temporary object.
Change-Id: I5f931a86d9dfad57d99efe04ca115422de43def9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These variables were never used or set to anything meaningfull.
Change-Id: Ic68ac5c38a3db28d7a5a05be004bcb6a554a1483
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
When building QNX on MS-Windows, make magically adds the Msys root as
prefix to variables whose values look like paths; this applies to both
environment variables and variables given values on the command-line.
When we don't actually want to install under the Msys root, this is
unwelcome "help". So (for MinGW's make) support a magic prefix of our
own, @msyshack@, that'll make a path value for INSTALL_ROOT not look
like a path to make; we can then strip it off when we come to use it.
Change-Id: I951ad3c8fe3e5cfb49e6e361d7fff779f3a9d716
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Create a MedianDouble class and V2 version of BlockSizeManager, which
use a fixed size array of double (since we always use 7 elements
to calculate the median anyway).
Change-Id: Ife90b90336a9a8c037b90726dee4cd2a1b8b6cd9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
From Qt 5.7 -> examples are lisenced under BSD license, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new BSD header instead of LGPL21 one
(in those files which will be under BSD)
Change-Id: I3ad61caaf07802eb9da7d29eca3fe49d8a51b6a8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Handle special case mapping of length 1 explicitly;
Skip calculating of high surrogate for the same plane;
Optimize branch prediction with Q_LIKELY/Q_UNLIKELY;
Replace peekNext() + advance() with just next() in the caller function.
Change-Id: I0d37969749bd8ca855321242e6a0e72c405c5f8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do ourselves and our users a favor by pointing out why Qt (Quick)
apps perform horribly on commonly used distros on the RPi. Using
a software rasterizer on such boards is not going to cut it.
Task-number: QTBUG-50533
Change-Id: I087f502ddb9c6bdde84343e6abd85c87cdc474f0
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Commit 6e6f27b6 made it possible to set the PKG_CONFIG variable using
CROSS_COMPILE as a prefix. The problem with that solution is that it makes
pkgConfigExecutable() skip the environment setup for pkg-config as well,
as it expects the pre-set command to be self-contained - which it isn't.
To avoid this problem we need to store the pkg-config define in the
device spec in a separate variable.
Change-Id: Id8ae7fb03d9253be55840e23fe73b30815ee86c3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
A switch had a case whose body was in a #ifndef; when that got elided,
this case fell through into an entirely misguided case. Give the #if
a #else clause so that it break;s in the defined case. Code review
revealed another, then I searched for more following the same pattern.
Change-Id: I57fb59b6c8d349604f3fc6c8b1d424fb3c775d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to the spec, pixmap type is ARRAY(INT, INT, ARRAY BYTE).
This also matches our QXdgDBusImageVector typedef.
Also fix the D-Bus Introspection class info.
Change-Id: Ic13e8a078299b9c76d2742055d64cfdc54460d58
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
When initializing the font members in the QGnomeTheme constructor,
the QFont constructor called QGuiApplication::font() which in
turn calls initFontUnlocked(), initializing
QGuiApplicationPrivate::app_font to QPlatformFontDatabase::defaultFont()
("Deja Vu 12") since QGuiApplicationPrivate::platformTheme() is still
0 at that point.
Change the fonts to pointer members and initialize them
delayed in QGnomeThemePrivate::configureFonts() instead.
Task-number: QTBUG-49095
Change-Id: I3282ea8484e04827be2a424f5ea3e34d607c4bc5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
The native socket engine used strcpy for WinRT, which tries to copy
terminating null character. The QSocketNotifier::async_readDatagramSlot
autotest uses a buffer of size 1, which causes readDatagram to overwrite
the buffer on the stack.
Hence use memcpy instead to protect from additional copies beyond
barriers. Note that we cannot use qstrcpy as that does a buf[size-1] =
'\0' at the end, which would remove content for a buf size of 1.
Change-Id: I20baf9e63646cd28c1c954a20b8ae9c7d5873c31
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
msvc2015 reintroduced a couple of functions from the win32 API
towards WinRT.
Enable usage of those and simplify the file system engine.
Furthermore update the autotests.
Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Use reverse_iterator, now that we finally have it.
Change-Id: If74ead1a6075c5437c1d111206913481a495a014
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The ABI says that PC-relative displacements should be on 32-bit fields,
even on 64-bit builds. For -mcmodel=large, it should use R_X86_64_GOT64
relocations, like 32-bit.
Task-number: QTBUG-50537
Change-Id: I1041122c530b4f5bbaabffff142ade5b3cbfc4c5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It's possible to configure an interface so that it isn't the case. I have
no idea if this is a valid scenario, but the unit test shouldn't enforce
that.
ip addr can report:
inet 192.168.1.1/32 brd 192.168.1.255 scope global vlan0
valid_lft forever preferred_lft forever
Change-Id: I8de47ed6c7be4847b99bffff141c337575760bd9
Reviewed-by: Richard J. Moore <rich@kde.org>
If SIOCGIFADDR fails, then don't bother trying to get the broadcast
address or netmask, and especially don't add the empty
QNetworkAddressEntry to the interface. This can happen on interfaces
that have no IP address assigned (for example, inactive interfaces).
Change-Id: I8de47ed6c7be4847b99bffff141c326d94ecca78
Reviewed-by: Richard J. Moore <rich@kde.org>