It was already forgotten for 5.0, let's not continue
to use Qt 4 BC hacks in Qt 6, too.
Change-Id: Ifa798115562ebd15dd9beade73a49dfbc23a208f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Localized font family names and their aliases are stored in font database.
However, fallbacksForFamily gets non-localized family names which results
in family name mismatch.
Change-Id: Iddf9101e15a0e49c5ba4c049969fc90cb7853443
Task-number: QTBUG-40978
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This patch adds indexOf and lastIndexOf with QRegularExpressionMatch
output overloads to QString. This allows to get the match corresponding
to the index returned.
[ChangeLog][QtCore][QString] Added support for retrieving the
QRegularExpressionMatch to indexOf and lastIndexOf.
Change-Id: Ia0ae2d3ff78864c7053ffa397874aca1d2b1c35c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Testing using an empty string doesn't ensure that the regexp
gets validated. The function may return earlier thus making
the test useless. This patch adds a text to search in so that
no early optimization avoids the regexp validation part
Change-Id: If24b77385dde44a922d43e5ae1d7a5393d24f640
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
There is a significant performance regression with using
QOpenGLVertexArrayObject::Binder on platforms not supporting VAOs. This
is because of the function resolving/initialization in create which is
called once pr bind if d->vao == 0.
Change-Id: I74e77f50921116c306247dc371c68b287a2e22d7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Unify the code of the two overloads; fix a typo in a warning;
and use an opportunity to insert a move.
Change-Id: I85eef86d35f0d1e2da25f09d92204e32abf6d7d3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
qt_section_chunk s larger than a pointer and wasn't marked as movable,
so holding it in a QList is horribly inefficient.
Change-Id: I32162b4960d32674a1f3b05bc24ac8813f16638d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
As a side effect, QString::simplified() will always return a detached
copy, even if it's the same contents.
QStringRef::trimmed() can use the same calculation algorithm but can't
use the trimmed_helper() template function due to its lack of a
constructor taking begin pointer and size (std::string_view could do
it). That constructor can't be added because QStringRef always refers to
an existing QString, not to data in memory.
Change-Id: Ib966c1741819c68c6bac5fcbb00f8ac818b3ccab
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This is even more common than the QByteArray equivalents.
Qt Qt Creator
const & && const & &&
toLower 71 50 45 26
toUpper 35 8 46 35
Change-Id: I8b797d2321b22ce414c23656c5f1709ac649c423
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This unifies the code for those three functions in one refactored
template function, using QStringIterator. I don't think there's any loss
of performance by doing that refactoring -- this is based on my reading
of the disassembly, without running any benchmarks.
Change-Id: I5893c6ed47462c473886c722a21577b1e8a23841
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Those operations aren't very common with QByteArray but this is easy to
optimize.
Qt Qt Creator
const & && const & &&
toLower 34 10 0 1
toUpper 3 1 0 0
Change-Id: I2097955f4c889ea5a21903c35ddbc0ff27bf62c5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The latin1 conversion tables that were recently introduced to qbytearray.cpp
to speed up QByteArray::to{Upper,Lower}() can also be used in qstr(n)icmp.
This results in speedups between ~2 for strings with differences in the
first char, to almost 10x for strings with differences only after 8k of
data.
Change-Id: I878ddb4c01c798069d439a9d33e24351fe1039d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Do a check first if we need to transform before doing the transform.
This means we won't detach when transforming data that is already
correct.
And instead of using QChar, use our own hand-rolled table. In a proper
LTO build, the QChar calls would be resolved to a lookup of the Unicode
data, but not many people do LTO builds, Therefore, this means a great
speed-up is achieved by simply avoiding the function call. The extra
gain in performance comes from the simpler translation table instead of
the more complex full-Unicode data.
Also as a consequence, this changes the handling of two characters in
Latin 1: 'ß' should be uppercased to "SS" but we won't do it, and 'ÿ'
can't be uppercased in Latin 1 ('Ÿ' is outside the range).
Benchmarking is included. Comparing the Qt 5.4 algorithm to the new code
is almost 20x faster. Other alternatives are included in the benchmark
and are all faster than the current code, though slower than the new
one. While all of them could compress the tables to be smaller or shared
between uppercasing and lowercasing, they would also expand to more code
(though probably less than the extra bytes required in the full
translation table). In the trade-off, I decided to go with simplicity
and most efficient code.
Change-Id: I002d98318d236de0d27ffbea39d662cbed359985
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
There's no point trying to continue, everything graphical is not going to work.
Change-Id: I4c85de63746618ddf73435b491a3244b7e53a76c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
It appears to have been an incorrect assumption that flush always comes before
resize. At least for me, that is not the case. It also strikes me as being more
robust this way.
Change-Id: Iafd2cfe7b89802899e844152e0901e588ff0d8a6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This patch makes the GTK2 theme read the font configuration and use
that as the default system font.
Task-number: QTBUG-39643
Change-Id: Ieacf8968e54f34c6d44669350d349c9a96ed6cc5
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Both bundling and debug deployment can use the local cache for
the Android style assets, since Ministro is not necessarily
available in these cases.
Change-Id: I33367aceec1829f27377fcb6793ca95ecf5cc434
Task-number: QTBUG-40676
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This patch adds support for reading autohint and lcdfilter settings
from fontconfig and pass them on to freetype.
Task-number: QTBUG-32254
Change-Id: Iaa69b70f7005ee7f21126a8d984c07b3a46a3e7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Add support for the four new RGB30 formats to qt_mac_toCGImage so
that they get converted to ARGB32_Premultiplied instead of potentially
misinterpreted.
Change-Id: I0921edaef7509c1db9bd547b454dade03d289ea3
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Not all Android versions appear to have f_flags in statfs, but we
can check for the presence using a feature define.
Change-Id: Ib2acf6063d6211b871f462ee491459ac8675aa37
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMimeDataStruct is larger than a pointer, so holding it in a
QList is horribly inefficient.
Fix by marking as movable and holding in a QVector instead.
Change-Id: If285dd31546066db0b240ea0d4d30668f50b5f2c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The enum would break on old clang trying to cast it to strings when
building webkit.
In file included from /work/build/qt/qtbase/lib/QtGui.framework/Versions/5/Headers/qimage.h:48:
/work/build/qt/qtbase/lib/QtGui.framework/Headers/qpixelformat.h:78:33: error: use of overloaded operator '+' is ambiguous (with operand types 'int' and 'QPixelFormat::FieldWidth')
Change-Id: I614cf89d0832dea505001d55188b4c748e948ef9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-The online URL doesn't use the minor version
anymore and this makes the non-Qt projects
depend on the existence of redirects.
Change-Id: I5b2bef16957ca307060600b7bf25eb1d55f2c998
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This error was introduced by the Make the expose region local on all
platforms fix.
Change-Id: I961a53cb81c400471dff112664aa6d56e445d21c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Make sure that the DirectFB plugin defines that it is capable of using
Threaded Pixmaps, Multiple Windows, and OpenGL when available.
Change-Id: I68a0a69568af8e00e47cd2c59bbf6a301df6ec34
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
On systems that give alpha configs by default writing alpha values of
less than 1.0 is a bad idea since it will lead to the content behind the
window becoming visible, even though this is not the example's intention.
Change-Id: I23cdfc1fb78d77b1cbc192d2aba5d6665a7acfcc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
The temporary pbuffer has to have a config that is pbuffer capable.
Otherwise the makeCurrent() can potentially fail with drivers that
strictly differentiate between the different configurations.
Change-Id: Id63f52da5c5a1308072b1f1bb4b297ea6a547166
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This patch contains two changes that were lost when RGB30 support was
merged. Documentation of the formats being added, and corrected
memrotate methods.
Change-Id: Ia3c87d7c984134576badbba92c421f832896cf97
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
To be able to use the SubpixelAntialiasingType enum without depending
on QFontEngineFT we need to move it to QFontEngine.
The patch also cleans up the left-overs of other enums moved the same
way.
Change-Id: I025bc8a5b429d376cfab0a643121ed6f99204988
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The current one is from 2012 and is based on the obsolete spec files.
Replace it with the new one generated from the XML specs.
At the same time fix the callback function signature for QOpenGLDebugLogger
since it would not build otherwise. The user parameter is const GLvoid *
according to the specification.
Task-number: QTBUG-39773
Change-Id: If2153198373eeebc587c41b2dbf6bed5bcb26761
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When generating the body of a documentation page, QDoc omits
the brief description for nodes of type DocNode. Since Qt 5.4,
a number of nodes are promoted from subnode types of DocNode
to top-level nodes -specifically,
- QML types
- Modules
- QML modules
- Groups
As a result we now see a duplicate or unintentional brief
description on pages of the above type.
This change instructs qdoc to skip generation of the brief
for also above node types, as it was on 5.3.
Task-number: QTBUG-40741
Change-Id: Id92dce27b13c68be0958225e04ed61813fdc91ee
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Replacing usage QString::split by QString::splitRef saves a few
allocations.
Change-Id: I1cadca296279248b75af6f9f8394c54f13c37c55
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
There is no need to allocate all these strings
Change-Id: I398e1cc05bd3ad24df067a967a5e24fbc6d452ce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
The code contained old Qt4 logic. There is no point in checking values
of QVariant as they are in sync with QMetaType.
Change-Id: I58ace52f69939488e6ea7e7bab98df38419420a8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The StorageView example demonstrates the QStorageInfo API.
Change-Id: Ifaabadbe64fdf26d13a4ce4690e6b54514667c9f
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
CRITICAL_SECTION has different members, so adjust that
strdup is only there as _strdup so use that
There is no MemoryBarrier()
There is no environment so dont use getenv
There is no locale so dont use it
There is no errno so just fake it
Change-Id: Ia7197c4f0df50513078c906ed503aec33ee42b82
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This allows for opening of public key files. It does not, however,
support opening private keys (or decrypting/encrypting them). This is
due to limitations in the native API.
Nearly all public key tests pass (the native API doesn't support the
40-bit key in the test set). The private key tests are expected to fail.
Task-number: QTBUG-40688
Change-Id: Id8f2f1ae6526540736ceb2e5371f6a5d80c4ba7b
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
The change creates a stub implementation for WinRT, adding the needed
files and classes to build SSL support on that platform.
Task-number: QTBUG-37497
Change-Id: Idc3e8aa91c5eb8a938705f2385d1074fe6c1d83e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
An event dispatcher fetching the core dispatcher can deadlock when
looking up the window. Simplify this by only looking up the view, and
treating the event dispatcher as one which will never obtain the core
dispatcher. This fixes a deadlock which occurs when starting network
delegates.
Change-Id: Ic27f4ab6f168eb95f3de70d78d64f035c331a7f5
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
The automatic registration code that would be added will break
with a reference type.
QObject's template code calls QMetaTypeId2 on the arguments of the
signal. Including on references.
Reference type cannot be register as metatype. They are not supported
in QVariant, or in QueuedConnection.
Change-Id: I83f2e50f9f886909dc24f3809c990e5763012cc2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
In addition change to the one in all file instead of individual
interfaces. Future updates only have to copy the new version of
ia2_api_all.idl and run nmake.
Change-Id: Ie7a1e65c8dd0c73809ac97aae2d586f425337f18
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>