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>
This allows us to support file descriptors >= FD_SETSIZE.
Change-Id: I7e4a35333446a587cfd13c077fa5e19fa3d1abc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of building a QMap with dummy values, just to sort the
elements of the QSet, build a QList, and sort that.
Also use QStringList::join() instead of rolling our own loop.
Change-Id: Iebb7faac8e4b72d6f71b3ab3feba7865b1a102f3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This fixes the rendering of translucent borders on CSS-styled widgets to
prevent visible overlapping at the corners. This is done by using a
miter joint (45 degree angle) if either of the adjacent edges are
translucent. Previously, adjacent edges would be drawn at full length
and overlap at the corners if both edges are BorderStyle_Solid and have
identical QBrush objects. This works if both QBrush objects are opaque
but causes visible overlap if one or both of them are translucent.
Change-Id: I99d46c8634cb314e642c635439ed2f7819fcba6a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The error message was not informative enough to troubleshoot.
Change-Id: Ib21fce238c80b31d21939d139fc173b48eb5ceb8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Qt 5.7 no longer contains lib/fonts. This is a regression for users
relying on Qt's own fonts when running on Embedded Linux systems without
fontconfig. To alleviate the pain, show a friendly message about this.
The old "is Qt installed correctly" note is out-of-date anyhow now.
Change-Id: Idcb732fb65ed9c45529a0bcc3168227e0969bea0
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Instead, allocate a temporary buffer on the stack. This prevents the
internal read buffer from being allocated if the device is opened only
for writing.
Change-Id: Ib91c58299206e92006589807527e7b71a5555c8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@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>
Remove several test from black-list - they do not seem to fail anymore.
Change-Id: Idb7d6925a4fdea9b47d963e33a455af0afb7b432
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@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>
... by replacing them with C++11 range-for loops.
Change-Id: I0561174d9981ee2171c23644b5e7aebeb8c25665
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 ramge-for loops.
Change-Id: I95a91ac36c2b2bef17bf12cf7f1676653a2d807d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for, or, for loops
over .values(), with explicit iterator loops over the result
of equal_range().
Some fixes here and there to get to mark containers const for
iteration, without having to resort to qAsConst(). Didn't work
everywhere.
Change-Id: Ibc0e71d3b208d118f06e16741af47261ef4b9e15
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
For QList<QLinkedList<T>::iterator>, mark the iterator Q_PRIMITIVE_TYPE.
This should be done in Qt itself, but would be binary incompatible.
For two other types that are used as values in QMultiMap, replaced
foreach (x, map.values(y))
with
auto range = map.equal_range(y);
for (auto it = range.first; it != ramge.second; ++it)
x = *it;
which doesn't require a temporary QList.
Change-Id: I9ddd15dd9b1d5bb3000833d14ed911451a272328
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... replacing them with C++11 range-for loops.
Change-Id: I0233bcf874cdadcd7461e11b89f752dabde086c0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... replacing them with C++11 range-for loops.
Change-Id: I13825a444dee30b56b08f3ad8a7a0e15bf324678
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... and QStringBuilder.
Found while fixing Q_FOREACH/foreach use in src/tools,
thus contains port to range-for as a drive-by.
Change-Id: I221bb8cb1f0fc3edeabfdb37d5d5a17551ee8d36
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for, or, for loops
over .keys() or .uniqueKeys(), with explicit iterator loops.
Saves 2300b in text size on optimized GCC 5.3 Linux AMD64 builds.
Change-Id: I6e1d4f5e56895dfd74aba21a3d4e913b5825645c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The old code searched for any Qt containers by looking at
- each class definition
- each property's type
- each function (signal, slot, method)
- each argument type
and matching each against "Container<", building
the pattern string each time through the loop.
It would then collect hits in a QSet to be converted
to a QList and sorted at the very end.
The new code pulls the iteration over the candidates
out of all other loops. By doing so, it can stop
looking at classes, properties, functions etc when
it finds the first hit, and it inserts every candidate
at most once.
By iterating over the statically-known list of
candidates, the result is not a sorted set of Qt
containers, as before, but it still has s fixed order
across runs, which was the purpose of the sorting in
the original code.
In the implementation, make liberal use of C++11
range-for, which is safe, as we're passing everything
around as const.
Change-Id: If76dd3f57aa1b544a9cf1de2dca94ca7999220f0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... and suggest to use C++11 range-for instead.
Change-Id: If4d4dec1a0cbbc2307ee7d2635f0a8fc3a1ec353
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>