I don't think we want to have implicit conversion
from a const char * or a QByteArray to a QUuid.
Change-Id: Idfe7450ce15b89e295aa7af7ccf1fc94f5acd4f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added overload to allocGrow that figures the capacity to allocate from
the newSize argument passed. This is useful in QList (and likely in other
places)
Fixed QArrayPodOps::reallocate as a drive by: don't call memmove when
it is not needed
Task-number: QTBUG-84320
Change-Id: I67efe55a60efaf3ab6057b0249d6a446e04a09e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No user of QArrayDataPointer functionality must use createInPlace. This
is a special function to be called by the internal logic. It's usage is
unsafe with prepend optimization in place
Task-number: QTBUG-84320
Change-Id: Idc0e82975a98e799272bdb61fe7828b3c8c67e8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Restored previously deleted logic of setting GrowsBackwards flag for
prepend-like cases. This should be sufficient to fully enable prepend
optimization
Fixed QList::emplace to not use implementation detail logic. Updated
tests to cover changed behavior and its correctness
Task-number: QTBUG-84320
Change-Id: I4aadab0647fe436140b7bb5cf71309f6887e36ab
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Introduced prepend optimization logic to QCommonArrayOps.
Trying to rely on original QList behavior
Task-number: QTBUG-84320
Change-Id: I46e6797b4edad804a3e3edb58307c9e96990fe01
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Introduced allocation function in QArrayDataPointer with
interface similar to QArrayData::allocate that supports growing
strategies. This func is used instead of the original in cases
when prepend-aware storage is needed. Tried to follow Qt5 QList
policy in terms of space reservation
Updated QPodArrayOps::reallocate to be aware of growing
shenanigans. It doesn't look like a perfect solution but it is
rather close and similar to what Qt6 QList is doing when not
growing (e.g. reserve/squeeze)
Added initial QCommonArrayOps with helper function that tells
when reallocation is preferable over just using the insert-like
operation. This comes up later on when GrowsBackwards policy is
properly supported in operations
Essentially, 2/3 main data management blocks for prepend optimization
are introduced here. The last one being a generalized data move that
is done instead of reallocation when existing free space is not enough
Task-number: QTBUG-84320
Change-Id: I9a2bac62ad600613a6d7c5348325e0e54aadb73d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fixed UB when QList::begin() iterator is used after a call to
QList::remove(). As QList is now effectively double-ended container,
there is no guarantee on iterator validity upon erasure
Task-number: QTBUG-84320
Change-Id: I27793f131e8e23a41ac6c2c1db0bdc61ee58891f
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
A comment is not good enough, Some of the enum members were even still
in use, or mentioned in documentation.
WA_ContentsPropagated, WA_WState_DND and WA_ForceAcceptDrops have been
deprecated since 4.5.1; and at least the last has been an \omitvalue
in the docs for even longer. (WA_ShowModal and WA_GroupLeader have
been similarly marked, but are in use, see QTBUG-85816.)
Push back to 5.15.1 in order to be able to remove these at Qt 6.
Pick-to: 5.15.1
Change-Id: I6ea3839767e5f5158b0fed508f65798470191908
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add new QIcon::pixmap() overload:
QPixmap pixmap(const QSize &size, qreal devicePixelRatio, ...)
This function replaces the existing pixmap() function which
take a QWindow pointer, and should be more convenient in use.
Task-number: QTBUG-85885
Change-Id: Ie4ca96a266d9278864678dc61bdfc2836cabdb93
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Stop relying on the "magic" of itemAt returning nullptr for out of
bounds. Just use count().
Unfortunately, QMainWindowLayout breaks the API contract by NOT
implementing count() properly. So, make its count() crash if called;
and move the itemAt implementation there.
Change-Id: I120686a834bab15dd537598a56bd93d6a5924aa5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
For historical reasons Qt 5 has:
int QPaintDevice::devicePixelRatio()
qreal QPaintDevice::devicePixelRatioF()
Change the int to qreal so that Qt 6 will have
qreal QPaintDevice::devicePixelRatio()
qreal QPaintDevice::devicePixelRatioF() [to-be-removed]
Change-Id: Ie904e02ec490cbcd2acb5dcecb193e9af4cb90f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Adding the role that changed to the itemChanged signal is
computationally expensive for the general case. Not going to be done,
at least not for Qt 6.0.
Change-Id: I3e6fca6a5c7b517c3c035477ce5d23d8870bad57
Reviewed-by: David Faure <david.faure@kdab.com>
With 64bits, the mask is exhausted with the 21 colors x 3 color groups
we have right now.
In order to support accent colors, we need more palette entries. By
moving the mask into the d-pointer, we can extend QPalette within
the Qt 6 series, without breaking binary compatibility.
The resolveMask/setResolveMask methods that take integers are
documented as internals, so we can change those signatures after
Qt 6.0 as well.
As a side effect, setting the resolve mask on a QPalette detaches now.
Setting a mask is in most cases done on the result of
QPalette::resolve, which is usually detached already. And the QPalette
default constructor will have to detach from the global application
palette if that palette has any colors set explicitly.
Task-number: QTBUG-82925
Change-Id: I1e70f1c4d0dd98303e353b91df5dba2b1fe8ba01
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
viewOptions returned a QStyleOptionViewItem object. Such a method
can never support newer versions of the option structure.
Most styleable QWidget classes provide a virtual method
initStyleOption that initializes the option object passed in as a
pointer, e.g QFrame, QAbstractSpinBox, or QComboBox.
Follow that API convention, but name it initViewItemOption, as the
QStyleOptionViewItem struct contains information about the item as
well as the widget itelf.
This is a source incompatible change that will go unnoticed unless
existing subclasses mark their overrides as 'override', or call
the removed QAbstractItemView::viewOption virtual function.
[ChangeLog][QtWidgets][QAbstractItemView] The virtual viewOptions
method that previously returned a QStyleOptionViewItem object has
been renamed to initViewItemOption, and initializes a
QStyleOptionViewItem object that's passed in through a pointer.
Change-Id: Ie058702aed42d77274fa3c4abb43ba302e57e348
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This was causing miscompilations with clang on macOS. As it's
not really required, remove the alignment requirement.
Change-Id: Iacef1af7f51990daddc73fe74449adc1a823aa33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Fix name of target so that qtattributionsscanner actually generates content.
Change-Id: Ie42067928d7cd1de02fa4ae92a0f5ef54bd54a5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Make sure the executable path contains an .exe on Windows.
Change-Id: I972a3aaf1ad0510525ebfcc84e8c589f555c6d00
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Use the official name and ID from SPDX:
https://spdx.org/licenses/libpng-2.0.html
Pick-to: 5.15
Change-Id: I199efd600373cdc150d48a449b122f90ff2c48ef
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
C4180, C4458 were disabled already in 2012, in commit 6668f5becf.
C4577 was disabled due to QtScript being compiled without exception
support in commit 97d7d80e73.
Anyhow, Qt Script is now officially gone in Qt 6, and Qt headers
do work just fine with C4180. Finally, C4458 is nowadays a W4 warning,
so not enabled in the first place.
Task-number: QTBUG-82615
Change-Id: I2f9b8e858817876b069a166129fbfac7ef3587a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The explicit paint event on QtGui and QPA level allows us to untangle
the expose event, which today has at least 3 different meanings.
It also allows us to follow the platform more closely in its semantics
of when painting can happen. On some platforms a paint can come in
before a window is exposed, e.g. to prepare the first frame. On others
a paint can come in after a window has been de-exposed, to save a
snapshot of the window for use in an application switcher or similar.
The expose keeps its semantics of being a barrier signaling that the
application can now render at will, for example in a threaded render
loop.
There are two compatibility code paths in this patch:
1. For platform plugins that do not yet report the PaintEvents
capability, QtGui will synthesize paint events on the platform's
behalf, based on the existing expose events coming from the platform.
2. For applications that do not yet implement paintEvent, QtGui will
send expose events instead, ensuring the same behavior as before.
For now none of the platform plugins deliver paint events natively,
so the first compatibility code path is always active.
Task-numnber: QTBUG-82676
Change-Id: I0fbe0d4cf451d6a1f07f5eab8d376a6c8a53ce8c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Added 6 new methods in QTextFormat and QTextDocument to
allow setting/getting specific % positioning for baseline and super/
subscript. Modified QTextLayout to honor those new settings.
[ChangeLog][QtGui][QTextLayout,QTextFormat,QTextDocument] Allow text
layout modification based on baseline offset and super/subscript % height
positioning
Fixes: QTBUG-18260
Change-Id: I0796f18224aac8df6baf8359c35022fd98fe64ef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QXcbScreen determines logical DPI using the following priority:
1) use Xft.dpi if set
2) virtual desktop size / virtual desktop physical size
(This change does not restrict or alter the value obtained from
Xft.dpi in any way)
The fallback option 2) has several problems:
- It is a physical DPI, which does not account for
viewing distance or user preference
- It is a global value for the entire virtual desktop
(not per-screen)
- X servers usually fake the virtual desktop physical
size such that the computed DPI ends up at 96; in
cases where this does not happen we can end up with
a surprising DPI value.
We might be better off just hardcoding 96 here, to avoid
picking up an incorrect physical DPI when for example
connecting to a TV (as reported in QTBUG-67928).
This change does not go as far as hardcoding 96, but instead
restricts the (fallback) DPI value to be 96 or higher.
Pick-to: 5.15
Task-number: QTBUG-67928
Change-Id: Ieea6c7a137261282b40302fb4c19273c5def10af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change the name/key of the style to 'macos'. Besides the
name 'macintosh' being archaic, we also need this
change to avoid creating 'macintosh' style folders
in QtQuickControls, now that we plan to use QPlatformTheme
also there to resolve the style.
[ChangeLog][Widgets][QStyle] The 'macintosh' style
has been renamed to 'macos'.
Change-Id: I14b8a8b4dbd369e7a7d16b94e4ad27e501e7e8d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Currently QFuture::waitForFinished() exits as soon as the future is not
in the running state. If the user calls it before
QPromise::reportStarted() is called, it will exit immediately, because
nothing is running yet. Fix the behavior to wait for the finished state.
[ChangeLog][Important Behavior Changes][QtCore] Fixed the behavior of
QFuture::waitForFinished() to wait until the future is actually in the
finished state, instead of exiting as soon as it is not in the running
state. This prevents waitForFinished() from exiting immediately, if at
the moment of calling it the future is not started yet.
Task-number: QTBUG-84867
Change-Id: I12f5e95d8200cfffa5653b6aa566a625f8320ca8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QString still has the overloads of relational operators taking
QByteArray. Add back QByteArray's relational operators taking
QString for symmetry. See also the comments of
d7ccd8cb45 for more details.
[ChangeLog][EDITORIAL] Remove the changelog about QString/QByteArray
operators being removed. They're back.
Change-Id: I22c95e727285cf8a5ef79b3a4f9d45cb66319252
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QCoreApplication has a special internal mechanism to control whether
the event dispatcher should block after delivering the posted events.
To handle queued connections in nested loops properly, we should use
that functionality.
Pick-to: 5.15
Fixes: QTBUG-85981
Change-Id: I124179a23b26a995cf95ed379e97bfa62c95f42a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is a z coordinate unrelated to tilt, AFAIK.
Amends ea2ae140e9
Change-Id: If165df3af290fbe7c2e5bfa94d578175debd53cd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The test explicitly asks for a non-native file dialog, which works on
macOS as well.
Change-Id: I964c6d98501b4207c2b6c2ce1df39f654c801a43
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Enough with the restricted bool trick; use the established solution.
[ChangeLog][Potentially Source-Incompatible Changes] QScopedPointer,
QSharedPointer and QWeakPointer's conversion operator towards bool
is now explicit. In some cases this may require an explicit cast
towards bool that was not needed before (notably, when returning
an object of these types from a function that actually returns bool).
Change-Id: I02b89278e75b7e7493ee7e35460504719e00f028
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
First, use QT_MKDIR instead of QFileSystemEngine::createDirectory(), as
the latter can't create a directory with the right permissions. That
would allow an attacker to briefly obtain access to the runtime dir
between the mkdir() and chmod() system calls.
Second, make sure that if the target already exists that it is a
directory and not a symlink (even to a directory). If it is a symlink
that belongs to another user, it can be changed to point to another
place, which we won't like.
And as a bonus, we're printing more information to the user in case
something went wrong. Sample outputs:
QStandardPaths: runtime directory '/root' is not owned by UID 1000, but a directory permissions 0700 owned by UID 0 GID 0
QStandardPaths: runtime directory '/dev/null' is not a directory, but a character device, socket or FIFO permissions 0666 owned by UID 0 GID 0
QStandardPaths: runtime directory '/etc/passwd' is not a directory, but a regular file permissions 0644 owned by UID 0 GID 0
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-tjmaciei'
QStandardPaths: runtime directory '/tmp/runtime-tjmaciei' is not a directory, but a symbolic link to a directory permissions 0755 owned by UID 1000 GID 100
Pick-to: 5.15 5.12 5.9
Change-Id: Iea47e0f8fc8b40378df7fffd16248b663794c613
Reviewed-by: David Faure <david.faure@kdab.com>
When configuring with Qt only with one ABI, certain code paths were
not triggered, which led to a few issues:
- The deployment json file generated by androiddeployqt listed
no architectures.
- The compiled shared library did not have a lib prefix and arch suffix,
which androiddeployqt during the deployment / make apk step.
To fix the architectures missing in the json file, ANDROID_ABIS needs
to be set in android/resolve_config.prf also in the single abi case.
To get the correct file names, android.prf needs to apply the prefixes
and suffixes not only in the build_pass case (multi-abi) but also in
the single abi case (except for config.tests).
The application-binary entry in the json file needs to be without the
extra prefixes and suffixes though, so make a copy of the TARGET value
to be used in the json file, before the name manipulations are
applied.
Pick-to: 5.15
Task-number: QTBUG-85399
Change-Id: Idde92ab7fe883636ccc65a87b91c8a3fc72eefbb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This doesn't give useful defaults on all platforms; icon themes are not
provided on platforms other than Linux, and the mime database doesn't
always return user-friendly names based on file names.
However, both icon themes and the mime database can be customized by
application developers by shipping a data file side-by-side with the
application, without the need for reimplementing the provider class.
Change-Id: Ie4b18ac1b861e2da64f01d1f209986b27fbe6bd5
Task-number: QTBUG-66177
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Apparently the Linux asm assumptions are not correct for the
x86 Android emulator and this caused Android apps not to work
properly: signal connections being queued instead of being direct,
crashes in QPropertyAnimation, etc.
Using currentThreadIdImpl on the Android emulator works fine though.
Optimizing the code for the Android emulator case can be done in
another change.
Amends 5e9b2ade67
Fixes: QTBUG-85640
Change-Id: I3b3ba76ea143aed949a6e50678c850b6ba231476
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Given QList-is-QVector, remove an historical piece of code.
Change-Id: I7a8876be8ade6dbaa1822d773b092ddb3c4182d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The convenience API used to look up the index of a named capturing
group expects NUL terminated strings. Therefore, we can't just
use it together with QStringViews, which may be not. Use the
non-convenience API instead.
Pick-to: 5.15
Change-Id: I25ca14de49b13ee1764525f8b19f2550c30c1afa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6.
Also remove sizeOf, it's unused, and we have QMetaType for that if
required.
Remove all typeinfo declaractions for trivial types, as the default
template covers them correctly nowadays.
Finally set up a better default for isPointer, and do some smaller
cleanups all over the place.
Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Configure Qt with -DQT_FEATURE_headersclean=ON to enable the
check. There will be separate target for each module include
(e.g. QtCore_header_check), but the check will also be done
when the module is built for the first time.
There are notable differences to the qmake version:
- the build does not pick up anymore default defines or flags from
the module, or Qt. Instead options like -fPIC they have to be listed
explicitly. Also for this reason, we have to skip the vulkan-related
headers from the check, since vulkan/vulkan.h is not necessarily
in the compiler's default search path.
- some checks for nowadays unsupported compiler versions are
removed.
- -Wdouble-promotion -Wshorten-64-to-32 is not added for clang
builds; the qmake code path did never enforce that on CI
machines (it was non-Apple clang only), and the check currently
fails on these configurations.
Fixes: QTBUG-82615
Change-Id: I1cd303677b1472116910b6c27748f96436feb35e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Keep the same behavior as desktop platforms with
QApplication::arguments() should return a string list of args
not a string of args together.
Task-number: QTCREATORBUG-23712
Change-Id: I1874655427f5c902ca81a3fcf6183d0eeccbfef7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>