This fixes compiling an application using QVector and -Wshorten-64-to-32
on a 64-bit system without getting this warning:
... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:695:18:
warning: implicit conversion loses integer precision: 'typename
iterator_traits<QString *>::difference_type' (aka 'long') to 'int'
[-Wshorten-64-to-32]
int offset = std::distance(d->begin(), before);
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:731:35:
warning: implicit conversion loses integer precision: 'long' to
'const int' [-Wshorten-64-to-32]
const int itemsToErase = aend - abegin;
~~~~~~~~~~~~ ~~~~~^~~~~~~~
... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:740:39:
warning: implicit conversion loses integer precision: 'long' to
'const int' [-Wshorten-64-to-32]
const int itemsUntouched = abegin - d->begin();
~~~~~~~~~~~~~~ ~~~~~~~^~~~~~~~~~~~
Change-Id: I52d85908f4aac20c7e9ac8063ac760ce52f85541
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These appear in insertSpacing() and insertWidget() only
and without any justification of why they may be needed.
Several other instances of the pattern these try/catch
blocks were guarding, i.e. allocate new QBoxLayoutItem
and insert to the list of items, were left unguarded,
leading us to believe this may not be useful at all and
can be safely removed.
Change-Id: I887fbde9d10e10f4f5daaa37f6f2892bd4038d58
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
If a floating QWidget has a parent on a different screen, its DPI was
still inherited from the parent instead of taken from the screen.
The only reason we did was in case there is a customDpi set.
(customDpi is a private thing that is only used in designer to change
the appearance of the previewed widget)
So instead of recursing into QWidget::metric for each ancestor, just
use a for loop to find if one parent has a customDpi. If no customDpi
is found, then return the DPI of the right screen.
Task-number: QTBUG-58959
Task-number: QTBUG-48242
Change-Id: Ie6e9e48cdd10234994c0919ba3aea9b0cdb52494
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Latest PCRE2 versions require a macro to be defined before
including pcre2.h, so do it.
Task-number: QTBUG-59226
Change-Id: I472ff557e29d1212fdcd99454778551323be4d4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the cache insertion fails, regexp is deleted and
"subject.contains(*regexp);" is UB.
Coverity-Id: 176868
Change-Id: Ibf9340e019f09fdb8b2a82de8877cdfb2ffe1372
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
We might get there because 'wid' is already partially deleted (called
from ~QObject). In that case, it is an undefined behavior to call a
QWidget member function on it. Use QObjectPrivate::get instead.
Change-Id: I6da314bf8385684d1332aa031a2d92012941303b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Move non-monitor-specific members of QXcbScreen to QXcbVirtualDesktop:
they relate to an X screen rather than to a monitor.
It allows to save some memory and X server callings that were
previously made for each monitor.
Change-Id: I079cdec5f27ca93a2aade00c3040936a0e50b494
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
As the destroyed() signal is emitted from ~QObject, it is not allowed
to use static_cast to a QAbstractButton on that pointer anymore.
And the qobject_cast will also fail which will keep a dangling pointer
in the hash.
Change-Id: If0d22fcc30cde87e771e70914c3afb04ea207289
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The color values of ppm and pgm images can be either 8 or 16 bits.
They can also be scaled to a smaller max value, and they can be
expressed either binary or ascii. For some of these permutations, Qt's
image handler lacked implementation or would decode the wrong color
value. This commit fixes that.
Task-number: QTBUG-18262
Task-number: QTBUG-35990
Change-Id: I7cf11c2366244f3a9b31c1a565a81e2658bc6a51
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
In fe97ecf408 we added support for
arbitrarily sized glyphs, since there is no guarantee that a glyph
will fit inside the em square. There was, however, a hardcoded max
size in the distance field generator, so for very tall glyphs we
could potentially get a crash.
[ChangeLog][QtGui][Text] Fixed crash for very tall glyphs
Task-number: QTBUG-57241
Change-Id: Id95c0f10d82a1294f7e7a51ac32e88a5a2e0a790
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Compiler support for lambda functions and variadic templates is
required since Qt 5.7, so no need to mention in the documentation
what happens if the compiler doesn't support it.
Change-Id: I5caeaa0bd7f0edce81e22e22964e0b7dd042c719
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This fixes the following Valgrind warning:
"Syscall param writev(vector[...]) points to uninitialised byte(s)
Uninitialised value was created by a stack allocation"
The xcb_send_event() requires all events to have 32 bytes.
It calls memcpy() on the passed in event. If the passed in
event is less than 32 bytes, memcpy() reaches into unrelated
memory. And as it turns out, this behavior is actually
described in the xcb_send_event function's documentation.
This patch adds a macro that declares an event for safe
usage with xcb_send_event.
Change-Id: Ifcaab5e9a3b52b7f64ac930b423e0c7798bbfedb
Done-with: Uli Schlachter
Task-number: QTBUG-56518
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
C0 to DF take one continuation byte; E0 to EF take two.
It's invalid UTF-8 anyway, but at least this is what the test row meant:
overlong sequence with 3 bytes of what should have been two.
This updates the comment to match the character that we were actually
testing.
Change-Id: I85a8bd6da2c44f52b4e3fffd14a75df2600487aa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
On POSIX compliant platforms, the default precision we apply to
preserving time stamps is seconds. However we can do better and use
utimensat() - if available - to increase the precision to nanoseconds.
The values are provided by statbuf's st_mtim. This is guarded for
compatibility with older systems, similar to commit
494ced1329.
Change-Id: I6928660230d84f8511bf0f58e268906d2e575e04
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Implement AVX2 versions of the three optimized paths of bilinear
texture transform.
Change-Id: Ie7199ef7dcce1e3457535fee35822d76afc0e8ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This technically just changes a compile time check to a run time check
and better options should be explored later, but it removes the compile
time dependency for now.
Change-Id: I58c5599baf2c338e88bd558a82093835124d6f67
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Also use canonical contact url.
Change-Id: I7faf9b329f4dd2c2a422d02e171bc2d39c359ed3
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Also use canonical contact url.
Change-Id: I61bf0990698a7021f1240deaf3eef2aff8f90a7e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace outdated LGPL21 with LGPL license header.
Use GPL-EXCEPT for all autotests.
Also use canonical contact url.
Change-Id: I6e5cc8a4285569c4f862730a980f492b8a933a72
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Change-Id: I34821150f66255df30d12572b27779e0e729ebc8
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>