The QFontCache instance is stored in QThreadStorage and thus calling
QFontCache::instance() isn't really cheap; avoid calling it multiple
times where possible.
Change-Id: I1b7a83089698a06c49dac08b2a3a8e9c3c75a500
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Since the likelyhood that decoration_size is greater than 0 then we can
save time with explicitly ensuring that it does not call the functions.
Change-Id: Iaf991a6c77bbc4908c459307ca7e645cf3b3ca20
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The error message was not informative enough to troubleshoot.
Change-Id: Ib21fce238c80b31d21939d139fc173b48eb5ceb8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Makes it clear that the engine for font with no Latin WS support
won't be cached as "shared" engine and thus shouldn't be normally
expected in the cache, so don't even try to find it there.
Change-Id: I9e6275b4919607f4057a193b446825c98932bd23
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
by inlining and reordering the condition.
Change-Id: I68a91e75071975a4cc26333094db3433afbaeb72
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The old code did the equivalent of strcpy(), thus stopping
at the first NUL byte, ignoring the QLatin1String's size().
That is not acceptable, for two reasons:
1. Appending QLatin1String to a QString uses the size(), too.
2. The QConcatenable claims an ExactSize = true, so
it cannot go and write less data than it's own
size() said it would. Even worse, it will happily
write _more_ data, too, if the QLatin1String is
not properly zero-terminated.
This change has low risk, because the equivalent change
to the QString branch has been applied between 5.2 and
5.3 (in fd0f1bc3), with no complaints from the user base.
It is also in a branch that is very unlikely to be taken:
Since QConcatenable<QLatin1String> is setting ConvertTo
to QString, any QStringBuilder expression containing it
will only implicitly convert to QString, not QByteArray.
In fact, I don't even know how to make it invoke the
changed code in normal operation...
Change-Id: I486a76352af7f318ba05da845d3afee7d826c92a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Set the NSImage size (which is in points/device
independent pixels) to inform Cocoa DnD about the
intended image visual size.
Change-Id: I6fadd77f4e0173e8e9773725fab3b35f70a055ff
Task-id: QTBUG-44179
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Uses a time derived via .toUTC() to ensure the .toLocalTime() comes
out at the time we expect.
Task-number: QTBUG-49008
Change-Id: I2005127929c7eab1b7a3cbaba8d21df8c9585d17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Make it possible to pass an optional root widget to dumpAllWidgets().
- Add option to output size constraints of widgets/windows.
- Output normal geometry of top levels.
Change-Id: Ib48809d070c5721fe4688a2ad39cb99f286618de
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Modules relying on font support via platformsupport (Qt Wayland) need
the static libqtfreetype.a. Add CONFIG+=installed to get it copied
during make install.
Task-number: QTBUG-50659
Change-Id: Ie6252e7f2dda1dc3da97fee258b9d53b7ca349c0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
10240 describes the first official non-preview Windows 10 SDK. 10586 was
the SDK for the first November update.
Change-Id: Ieb61b944295946eab594b3c7bf234155a67b752e
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
This allows users to add mobile specific features. Also it implicitly
enables support for continuum on Windows 10 Mobile.
Change-Id: I965123722f46df6e84fd279c3bfce478c1172632
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Hide the native view in constructor and in destructor.
Task-number: QTBUG-40159
Change-Id: I200b28af9ac2928c38299b71395a97e39f1bbe6d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.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>
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>
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>
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>
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>