Repeatedly calling QVector::erase(it) (via QMutableVectorIterator::remove())
results in quadratic runtime.
Use std::stable_partition, which does exactly what the old code tried to do,
except in linear time.
Change-Id: I6e5911ee781071bbb84d72449c969e3b9907da51
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The capacity of 'result' is reserved, but QVector::clear() always
deallocates. Fix by using resize(int) instead, which at least
preserves capacity when it has been reserve()d.
Change-Id: I198d532661f4f767588c4ce244c2454eb8823e54
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Repeatedly calling QList::erase(it) (via QMutableListIterator::remove())
results in quadratic runtime.
Use std::remove_if, which does exactly what the old code tried to do,
except in linear time.
Change-Id: I682e5e05f04953ae1c8788e5d66335241de39fee
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Repeatedly calling QVector::erase(it) (via QMutableVectorIterator::remove())
results in quadratic runtime.
Separate the removal of expired objects from the sending of the event to
the remaining objects, so we can use QVector::removeAll() for the former,
which does exactly what the old code tried to do, except in linear time.
Use range-for for the sending-loop. This could cause detaches, but since
we modify the container two lines before, and we don't copy it anymore,
anywhere, detaches are impossible.
Change-Id: I9aa6427e3646c8ad92b673fe42a86a0dfe79ee80
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QAbstractItemModel::rowCount() is a potentially expensive
operation, so cache its value whereever possible.
Change-Id: Ib2829b20a0fedcbf091a535945b88db323b53fbe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Due to kerning and other OpenType features, it's possible
that the advances from the shaping process are fractional, but
this gives uneven glyph positioning for font engines that don't
support subpixel positioning (since the glyph will not match the
expected position, some gaps will look too large and some
too small). To match how e.g. GDI renders this, we round the
advances before setting the glyph positions for engines that
do not support subpixel positions.
[ChangeLog][Windows] Fixed uneven kerning for some fonts.
Task-number: QTBUG-48546
Change-Id: Ic00dc402abf7149aab6bf9b05b42827b805c1a15
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Symmetric text rendering seems to be the equivalent to no hinting
at all since it does subpixel antialiasing in both horizontal and vertical
directions. Let people select non-symmetric, natural rendering as well,
by setting vertical hinting on the font. This is the mode used for many
UI elements in newer versions of Windows (like the title bar of windows
etc.)
[ChangeLog][Windows] Added differentiation between vertical hinting and
no hinting in DirectWrite font engine.
Task-number: QTBUG-48546
Change-Id: I2f75ae2d16fdf26706587d92da43daf29afbbcf2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
When a fallback font is selected, we need to copy out the
properties from the main font which can be synthesized
by the font engine. In particular, this is weight > normal,
and oblique style.
This is the DirectWrite equivalent of
a856c4a902.
Change-Id: I5d1215c66a433c8a8029c06e7a3dcee287f3f76f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This is convenient when we you want to check which permissions the
application has been granted at run-time. On Android device running
Android 6.0 or newer the permissions might be changed by the user,
so there are cases where this will be needed to determine what
APIs are available. On older devices or if the application is built
for an older SDK version, the old behavior is used, that is, the
permissions from the manifest is the permissions the application has.
Change-Id: I17ad588b35b26dd7ab26fa4b749764c1602c6854
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This follows up 130c2baa93.
Change-Id: I2f6c9b4f995af427cec9a2162b782039debf8564
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Intrinsics headers are associated with compilers, not OS's. This
change fixes a broken MinGW build triggered by
29bc68cf16.
Change-Id: Ib9e4ea3e25bf49d38a754a246b9433bc078bbb18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
cmd.exe uses a different set of characters to split arguments on, which
is not compatible with CommandLineToArgvW().
See https://technet.microsoft.com/en-us/library/bb490880.aspx.
Task-number: QTBUG-49641
Change-Id: Ic90fe6b1cbe84978a02fffff141b8f961a43ad28
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When configure.exe doesn't know what -platform to use, its message is
poorly-formatted (and unhelpful). This at least fixes the formatting.
Change-Id: I0f9fa3106a86606255ba05e80730031f1548faec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
no idea why it was limited to linux. the variable is already empty on
platforms which don't support it anyway. also, for plugins, it's
consistently enforced as well.
Change-Id: I117f4988a2e301ca98cdc088188d6f8c44ea0ba5
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
DirectWrite is not supported on Windows XP.
Task-number: QTBUG-49711
Change-Id: Ie1df6250814226d53fe4fb3a1c6bd024f6018796
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Restore the condition for deciding what a private header is from
fe383e04 to not check *_pch.h files and third party headers.
This amends commit eddb938c.
Change-Id: Idc55269478e7f2c98fb7debceef8a53c3cb5c657
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Previously, one had to skip 1300 lines of documentation before
seeing the actual code in this file.
Task-number: QTBUG-38890
Change-Id: I5a375cbe6b62575f6040e952a0931ac8ea2dd557
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
qt5 qmake is perfectly capable of complex expressions on the LHS.
Change-Id: Ibf8c82a4aa1a419895c6012610269e1cc9ca93ab
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Whenever a qml plugin is made static, the qmldir and other related
files need to be compiled into the resources, so they can be found
in the import path. By using qrc:/qt-project.org/imports, we can
have this taken care of automatically for us via the build system,
leaving us to just ensure that it is initialized in the code.
Task-number: QTBUG-35754
Change-Id: Ifa7e2a66fd78dc6713dd7a8661ea2c155b174d35
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
For some reason, the solution generator was looking for the vcproj
files in the source tree. It should look for them in the output tree
instead (suggested by Joerg Bornemann). This should handle both
in-source and out-of-source builds, and the special-case code for
handling out-of-source builds (which had a bug) can be removed.
Task-number: QTBUG-49665
Change-Id: I40b5c5907c52ffb074ccb8f297bb5924eacc1cb0
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Only add C++14 to the project configuration when C++14 support is
available on the platform. Adding it because the platform supports
C++11 doesn't work when the platform _only_ supports C++11 (e.g.,
QNX 6.6.0).
Task-number: QTBUG-49491
Change-Id: I15de38bb06d912a314b9dd18c80b513cc06a855e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The file exists but it isn't listed in TESTDATA. This is only a problem
when the target is a another system as is the case with Qt for QNX.
Tests fail because the file isn't deployed.
Noticed this while testing the changes for custom spacing of JSON
output.
Task-number: QTBUG-47437
Change-Id: I098c34d2ab9027956d9233b24f30b5192ecfe96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Nicely ask the compiler if it has a built-in for clz/ctz before
resorting to CPU specific brute force measurements.
Change-Id: Ifa992267ec4528219d7da14524af738316ceeaea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use SW_SHOWNORMAL instead SW_SHOWNOACTIVATE as a parameter to
ShowWindow() to enforce the window to be restored to normal state,
even if the state before minimized was maximized.
Task-number: QTBUG-48449
Change-Id: I9436623b1495f574a72050e50e8b31bfc83ced5c
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Since we are storing pointers to the elements of the
vector thus copied, we better make sure we don't cause
it to deep-copy. The old code was fragile in that sense,
using a reference removes one layer of potential mess-ups.
Change-Id: Ib8ebbb47c2a478b5e666e767d05429700b528afd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Scope some variables better and drag a constant
expression out of the loop, at the expense of
executing it unconditionally. That should not
be a problem, as all operands of the expression
are calls to const member functions.
Change-Id: Ibcf54b2e2faf9a818df7d12c0790c1f173c8a8ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
More efficient, because control block and tracked object
are co-located in a single memory allocation.
Change-Id: Ibd1a37836b96837afd6209a743a05a727dbc9907
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Make it opt-in because doing a normal backingstore flush does not seem to
work on Cocoa once we use OpenGL on the window. Windows and Linux should
be able to cope with this.
This means that platforms outside Windows and Linux will continue to have
the problem of having GL-based compositing enabled for ever after having a
QOpenGL/QuickWidget shown in the window once, but the issue is most
prevalent on Windows anyway, OS X machines can deal with OpenGL better
in general.
Task-number: QTBUG-49172
Change-Id: I30fd2efa95cc4f6eed9cf7f7613d0750355c775c
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
This is needed to be able to use Qt (with dynamic ANGLE) in a plugin
while the host runs a different version of Qt (and ANGLE).
In addition to changing the LIBEGL_NAME and LIBGLESV2_NAME variables
you also need to update the value of the LIBRARY definition in the
.def files for ANGLE:
qtbase/src/3rdparty/angle/src/libGLESv2/libGLESv2[d?].def
qtbase/src/3rdparty/angle/src/libGLESv2/libEGL[d?].def
Task-number: QTBUG-48431
Change-Id: Idd00d039ba3e20cc0ec7496bee36ed1c90383b0d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The new API has been available since 10.6 or 10.7 and the debugger
indicates it simply calls through to TransformProcessType.
Change-Id: Ia8f82d7426cb409aca8fd5feb8e43e1b0e79f8f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This function is introduced to safely provide poll(2)-like semantics for
socket multiplexing on Unix-like platforms. For platforms where no poll
system call is available, an implementation based on select(2) is provided.
Change-Id: I320e97dae5924316675a74d1897c48cae292ac6d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Without this patch, setLayoutDirection() is called only by LanguageChange
event handling, which triggers only upon installing, removing, or clearing
QTranslators.
This caused two problems:
* If the QTranslators are installed in a Q_COREAPP_STARTUP_FUNCTION the
event is lost since the QGuiApplication is still not there.
* If the application doesn't use QTranslators at all, i.e., uses gettext,
some other translation system, or because it has no messages at all,
setLayoutDirection() is never called and the layout direction is wrong.
The initialization of layout_direction has been changed from
Qt::LeftToRight to Qt::LayoutDirectionAuto but that has no
impact since QGuiApplication::layoutDirection will make sure
Qt::LeftToRight is returned if layout_direction has still not been set.
Change-Id: Ic60fe9a318c8afe1c503e3796ec54cfc687e7164
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Visual Studio version specific changes have been added to msvc-
desktop.conf which is not used in WinRT or Windows Phone related builds.
Hence take a similar approach to gcc and introduce msvc-base to be used
by all configurations for common settings.
For WinRT this will only be applied to msvc2015 and later on to not
introduce any regressions or behavior changes for previous versions.
Change-Id: Ib1a4d539d46d788470c00cb5969fee74a803bd67
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
don't install the module .pri file into qtbase even when doing a
non-prefix build.
this has no effect on modules built as part of a top-level build, as
they announce themselves via .qmake.super anyway.
however, modules built separately become unavailable unless QMAKEPATH
or QMAKEMODULES is set. this is deemed not relevant by the original
audience of this feature (the qtwebkit team).
Change-Id: I14c170b2c5dbb99608939aef1a541563d5b755d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Don't reuse 'w' as the loop variable for every loop in the
(very long) function. Scope the variable closer, or, where
there are no natural scopes, define a new variable.
Required turning some while loops into (more natural) for
loops.
Change-Id: I7d1a52503aeb19cd76be22153ba3d0961bd44cae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
With the addition of Qt::AA_EnableHighDpiScaling testing
of the env. variable only is no longer sufficient.
Use QHighDpiScaling::isActive() instead, which is
available at the time loadAndroidStyle is called.
Change-Id: Iaa6bbb5a04a71fa3bd68f3bdc8c8bcdfb5d1778f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
If we want to sort according to file types, we're also
sorting user visible strings. For that we can also use the
natural comparison collator, as file types should be case
insensitive, and won't contain numbers. And even if they do
a natual sorting will make it easier for the end user to find
what they are looking for.
Change-Id: Ie1d7d0af041a08be0f0d1a4eeb2eae9be885ffc7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The old code was extremely inefficient, and QCollator
can provide the same functionality in a much better
and faster way.
Task-number: QTBUG-30902
Change-Id: Iaf5dbe587d9a6ebca26885259fdee74a29d3c84f
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
QVariant was using QColor::name() to convert a color to string, which by
default loses alpha value. The patch is fixing the problem by always
including the alpha value in the string when required.
[ChangeLog][Core][Variant] QVariant(QColor)::toString() uses
QColor::HexArgb format when the alpha component is different from 1.
Task-number: QTBUG-37851
Change-Id: I887460c1ea151180ba99d64dd873ba9d6e2268f2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
QKeySequence::PortableText is the default value for argument passed
to QKeySequence::toString(), and it doesn't need to be mentioned
specifically in description for Qt::AA_MacDontSwapCtrlAndMeta enum
value.
Dropping the parameter shortens the text string, allows browser to
better wrap the table text, and gets rid of the automatic horizontal
scrollbar in online style. This improves readability for the entire
table.
Change-Id: I7051f5415a7a100b8c76f23b06b6cb9a2b0699ef
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>