Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.
Create QString from QStringRef only where necessary.
Add overloaded functions with QStringRef arg
in QDBusUtil:
- isValidUniqueConnectionName()
- isValidMemberName()
- isValidPartOfObjectPath()
Change-Id: I4a24a298702728ba7d3a65c39e25c3a9c759e07f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It was hidden by overridden parent(const QModelIndex &) methods.
See also 63b5082ea8
(Unhide QObject::parent() from QAbstract{Table,List}model).
Change-Id: I8b6d4d4175e4d43ff269eaeb0b2b1a9fb8f44bab
Task-number: QTBUG-45393
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Under Windows, the default paths are not correctly set, hence it's
necessary to explicitly set this.
Change-Id: I9779485115a93bdaf6eb6be87293ca921746bae7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
If the container being added to is default constructed and has never
been modified, we don't have to do all the checking and iterating.
Instead we can just assign with operator=.
If the LHS is merely empty, we could lose reserve()d capacity, so only
do this for a shared-null LHS.
Change-Id: If1e3342662d10833babc7ab847ada0285073723b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
libdbus will send a local signal if connection gets disconnected. When
this happens, end all pending calls with QDBusError::Disconnected.
Task-number: QTBUG-51649
Change-Id: I5c7d2a468bb5da746d0c0e53e458c1e376f186a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... by replacing them with C++11 range-for loops.
To avoid detaches of these mutable Qt containers,
wrap the container in qAsConst().
Saves more than 2KiB in text size on optimized GCC 6.0
Linux AMD64 builds.
Change-Id: I9610e711edc01d2a1ba19fef65d6b000ffc77255
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
In addition to pen events being handled as tablet events, we create
touch events. Same principle is used on other platforms as well. This
allows devices as Surfaces to use the pen with Qt applications.
Furthermore, the first update event does not have to be a press event,
as in a pen has proximity values describing a move without touch, but
also the HoloLens uses touch points as permanent pointer devices. They
all send an exit event once released or out of range. Hence, clean up
the internal touchpoint hash when the touch device is gone, not on
release.
Task-number: QTBUG-38681
Change-Id: I38acaa034a3cfe224098bfa36bfead5428f4db16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
IInputStream::ReadAsync might create a separate buffer to fill in data.
Passing a buffer with GetAddressOf() can cause a memory leak of the size
of data to be read.
Instead, pass a separate buffer pointer and continue to use this one
after the async operation. This way, the OS can decide whether to switch
buffers or not, keeping ref counting in sync.
Task-number: QTBUG-52961
Change-Id: I9dfb627287142355ebcf74ca52427b4e8108e8d1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This is not exhaustive, but was enough to discover ICEs.
Change-Id: Ib60be1d298a66b72e3eb9b75ad538f0bf15b5f62
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Simo Fält <simo.falt@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][Important Behavior Changes] Support for DirectFB is no
longer enabled by default, due to lack of development in upstream. To
re-enable the platform plugin, pass the -directfb option to configure. If
there is no interest in this platform, the support will be deprecated in
Qt 5.7 and will be removed in Qt 5.8.
See: http://lists.qt-project.org/pipermail/development/2016-March/025273.html
Change-Id: Icaa7fb2a490246bda156ffff143c62515a5f575b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The existing code keeps the overrides from each base class together,
so also move them to the correct group after adding Q_DECL_OVERRIDE.
Change-Id: I5d89fb4e7f9454ab0c9c6383f8245e64b95e84e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The proper solution with qCalculateBlockSize will come for Qt 5.7.
Change-Id: Ifea6e497f11a461db432ffff14490788fc522eb7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Basic optimization of conversion from indexed8.
Task-number: QTBUG-35747
Change-Id: Ic9d32789769eadb05fbecfebf2d2f2c87d66610b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
this adds file_copies.prf, which understands the variable COPIES, which
works analogously to INSTALLS.
i've been holding this off for a long time, as it is not without
caveats. however, similar hacks are proliferating all over the code
base, so it's time we formalized it.
in fact, it's the easiest way to fix some nasty shadow build problems,
which is why i'm adding this on the stable branch.
Task-number: QTBUG-52256
Change-Id: Icbe3b9fbb79c952546aad2d467a438d3a69d749f
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Limit the height of the the wave-pixmap so that fillRect doesn't clip
it.
At the same time the precision of the generated wave-pixmap is improved
so it better fits the requested radius.
Task-number: QTCREATORBUG-15851
Change-Id: If754387b20ab7b015857ecb0a0e8fe16de1d728a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Do not set WritingSystem supported just to unset it afterwards;
test in-place and fallback gracefully.
Change-Id: I6910019c08fcf3909b924c27271547aae2ea0ff1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
There is already an array of writing systems for which
GSUB|GPOS table is required
(also rename it from "openType" to "capabilityForWritingSystem",
to reflect its meaning).
Change-Id: I7cfd4a80d5ca13f9312b3644b2bd738d6015c71c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
There was a small logic error in the code selecting the debug/release
C(XX)_FLAGS used when compiling qmake, that could lead to us not
specifying any flags at all.
Change-Id: I5d3c44367d535a17570e3602029b84a02706d624
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Override preceding Common-s with a subsequent non-Inherited,
non-Common script.
This produces longer script runs, which automagically improves
the shaping quality (as we don't lose the context anymore),
the shaping performance (as we're typically shape a fewer runs),
and the fallback font selection (when the font supports more
than just a single language/script).
Task-number: QTBUG-29930
Change-Id: I1c55af30bd397871d7f1f6e062605517f5a7e5a1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
... by replacing them with C++11 range-for loops.
The function QObject::children() returns by const-reference,
so its result can be passed to range-for without further changes.
Saves ~300B in text size on optimized GCC 6.0 Linux AMD64 builds.
Change-Id: I8360e946774b0d30233c0fa68f318872da61e867
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... (or trivially marked const) local variables,
parameters, or data members, by replacing them with
C++11 range-for loops.
Saves ~1.5KiB in text size on optimized GCC 6.0
Linux AMD64 builds.
Change-Id: Ief6c0cbf08bcdcda28cb8ce6d72a13b7b6ac59c2
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by stopping the work when finding the first RGB candidate,
and otherwise only remembering the first candidate as a fall-back.
This way, we don't need to allocate memory as we did when collecting
the candidates in a QVector.
Saves more than 800b in text size on optimized GCC 6.0 Linux AMD64
builds.
Change-Id: I7d0cae69fa421fed881dd5a0f1aa45035d8f7461
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... iterate over the container itself instead. Avoids
temporary QList creation as well as the lookup cost
when actually calling value(key).
Saves more than 1KiB in text size on optimized GCC 6.0
Linux AMD64 builds.
Change-Id: If4b2fb7eada0e9cde72ab101a5f6e5cb1ba64054
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Simplify curves ourside the clipped area with a straight line that
closes the path, but saves us a lot of time and memory when zooming in
on a path.
Change-Id: I437f7eab564b805ebbefccd6755060156227c88d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
For CoW types, prefer const methods to avoid needless detach()ing.
Mark predictNextRequest() as const, because this method
does not modify the object.
Change-Id: Ic94e2b31445ece46ab1423bf5b5f4e66d9a5b6ca
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
In QFileDialogPrivate::_q_enterDirectory() the QStyle::styleHint() for
QStyle::SH_ItemView_ActivateItemOnSingleClick was called w/o the
widget. By such usage the possible StyleSheet setting was ignored, e.g.
"QAbstractItemView { activate-on-singleclick: 1; }".
Task-number: QTBUG-50871
Change-Id: I7a32c4841db7113f32c3823581c2becc1677e3cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
In some cases we move menu items around, therefore we should
not rely on QCocoaMenu::items() being the actual items inside
the menu. But, since the NSMenu is updated before hand, we can
rely on NSMenu.numberOfItems instead.
Change-Id: Icd4497beca4f52a6d38408eeaa2e6ec71b579685
Task-number: QTBUG-52931
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This is a regression with 5.5, it causes some customer test functions
crash. d3d10cf2 introduced the 5 minutes timeout. The timeout could be
changed after this.
Task-number: QTBUG-52402
Change-Id: I8940bbde5004b4d888732b551274f079ddf20563
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Always prefer the requested font, even if it doesn't support the
script of interest, and fallback to a font that *does* support that
script, so that the best-matching font always takes a precedence.
The result looks much closer to what CT and GDI/DW does.
Task-number: QTBUG-35836
Task-number: QTBUG-39377
Task-number: QTBUG-43408
Change-Id: I6a89593565683f318f7292ec5ecf271dadc4142a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Since they are non-characters and should not be used for text
interchange, it stands to reason that they should not appear in
unencoded for in a URL. To change the behavior, we just need to toggle
a simple flag for QUtf8Functions.
This behavior also matches the recommendation from RFC 3987. We do not
usually follow recommendations from that RFC (as it is generally
believed to be a bad RFC), but this one seems like a good idea.
Change-Id: Ifea6e497f11a461db432ffff1447486c623c12bd
Reviewed-by: David Faure <david.faure@kdab.com>
It's been unused ever since it was added in
bba86a01c9.
Change-Id: I6d5bc27a0744d37f873245c92a4e6ba8fc90c062
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Similar change to 390ea21873, but more
extensive because the hash variables were not, yet, of unsigned type.
This brings the three hashed string search algorithms in QtBase (in
QString, QByteArray and QByteArrayMatcher) in line again.
Found by UBSan, fixing the following bunch of errors:
tools/qstring.cpp:3080:38: runtime error: left shift of negative value -1291179264
tools/qstring.cpp:3081:42: runtime error: left shift of negative value -1291179264
tools/qstring.cpp:3091:13: runtime error: left shift of 73 by 26 places cannot be represented in type 'int'
tools/qstring.cpp:3091:13: runtime error: left shift of negative value -1255957171
tools/qstring.cpp:3091:13: runtime error: signed integer overflow: 1783052986 - -1207959552 cannot be represented in type 'int'
tools/qstring.cpp:3097:37: runtime error: left shift of negative value -1298753576
tools/qstring.cpp:3098:41: runtime error: left shift of negative value -1298753576
tools/qstring.cpp:3107:13: runtime error: left shift of negative value -1508912760
tools/qstring.cpp:3158:38: runtime error: left shift of negative value -677037574
tools/qstring.cpp:3159:42: runtime error: left shift of negative value -677037574
tools/qstring.cpp:3169:13: runtime error: left shift of negative value -1657715810
tools/qstring.cpp:3173:38: runtime error: left shift of negative value -677037574
tools/qstring.cpp:3174:42: runtime error: left shift of negative value -677037574
tools/qstring.cpp:3183:13: runtime error: left shift of negative value -1657715810
Change-Id: I1436eb61369919df9fe34251f863dd54fb58af98
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The MSVC STL warns when passing naked pointers as non-bounded
iterators to algorithms such as std::equal and std::copy, in
an attempt to inform users that the range specified by that
iterator has an implicit minimum size that the caller of the
algorithm must ensure is met:
warning C4996: 'std::_Equal1': Function call with parameters that may be unsafe - \
this call relies on the caller to check that the passed values are correct. To \
disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to \
use Visual C++ 'Checked Iterators'
When building Qt, as well as when building user projects with
qmake (cf. 0a76b6bc7f), we
globally disable this warning (with -D_SCL_SECURE_NO_WARNINGS),
but since we started using STL algorithms in public headers (e.g.
in qvector.h), users get this warning in their own projects now,
unless they, too, define said macro. But such a requirement is
against the Qt policy to have headers that are warning-free as
much as possible.
The suggested way of fixing this warning is to wrap the naked
pointer in a stdext::unchecked_array_iterator before passing it
to the algorithm, cf. examples in
https://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.120%29.aspx
or, together with the capacity-made-explicit, in a
stdext::checked_array_iterator.
To avoid ifdefs for platforms that don't have these extensions
(which, incidentally, for the unchecked case, includes MSVC 2012),
wrap the calls in macros.
The end game here is to drop -D_SCL_SECURE_NO_WARNINGS, at least
for public headers, even though this commit also adds the wrapper
to implementation and private header files.
An alternative to the wrapper would have been the version of
std::equal that takes four iterators. However, that is a C++14
library feature, while this version of Qt still needs to compile
with a C++98 compiler, and, more importantly, there isn't, and
never will be, a corresponding 4-iterator version of std::copy.
Task-number: QTBUG-47948
Done-with: Stephen Kelly <steveire@gmail.com>
Change-Id: I1bbab257fb5f1c5042939c382a412b596112ff26
Reviewed-by: Stephen Kelly <ske@ableton.com>
... by replacing them with C++11 range-for loops.
This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.
Change-Id: I982851f15868e62b7a191676ddf4ba6b92c0a42d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... to prevent hidden detach(es| attempts).
Saves ~160b in text size on optimized GCC 6.0
Linux AMD64 builds.
Change-Id: I74e1f1304c522b9a4349918e99f562853ec8684e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by aggregating similar blocks under multiple case
labels, and caching functions's return values.
Even saves a few bytes in text size on optimized GCC 6.0
Linux AMD64 builds.
Change-Id: I5784567a09732b4e55b64163b69e7a946f0783ae
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Pushing the mouse rapidly to the top left corner causes KDE / KWin to
switch to "Present all Windows" (Ctrl+F9) mode, showing all windows.
This has been observed to be triggered programmatically by
QCursor::setPos(0, 0) if there is no other window beneath and apparently
depending on the perceived mouse "speed".
Suppress this by using the bottom right corner for XCB.
Change-Id: Id18d2f45a095ed4d4f365f010cf45a20b0d9435e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Use High DPI when interfacing with the Accessibility API.
Task-number: QTBUG-52943
Task-number: QTBUG-50991
Change-Id: Ica4489222dca5d58864172470e634f709deb69f8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We have a bug that proximity events are generating them spuriously;
this is a way of testing it.
Task-number: QTBUG-52921
Change-Id: I490dfcf8d5b325f612b733e29fd49de9418bb19e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This is equivalent to d7db6c6c19 on the
xcb platform.
Task-number: QTBUG-51617
Change-Id: I837a764c8382244307ba6aa02bd8bde12bd08bff
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
But keep the 'Implement me' as a comment.
Remove default label from the switch to indicate that
the warning is only for the conical gradient case,
and not for the NoGradient case. Also enables
compiler warnings should we ever decide to add
another gradient type.
Change-Id: I891e652ff0293b4b4c254c7a55ebc6120b4fbcb6
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Change-Id: I97821ffa0c485815c781dc4f98012b0b490da90a
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
While this wouldn't have any consequences in practice, it was
perceived as confusing to users that Directwrite 2 was listed
as enabled in the summary when Qt was configured with -no-directwrite.
To give a better presentation of what will actually be compiled,
we force disable Directwrite 2 when Directwrite is disabled.
Task-number: QTBUG-52952
Change-Id: I779772ecc4d47b20854588cedde2b097ae22ded4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>