Also mark constructors explicit, where applicable.
Pick-to: 5.15
Fixes: QTBUG-84859
Change-Id: I145d366d854fd6b4373bcc23d0b880d6361d9014
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
operator-> comes with the precondition that the smart pointer
is not null. Having null d-pointers is a valid use case, so
enable it by using get() instead of operator->().
Change-Id: I78d77ca8c44e92a65ca98b15d0620bc3a1917ad2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
qmake_use.prf understands the _DEBUG and _RELEASE suffixes for
QMAKE_LIBS_XXX entries. The CMake configuration "Debug" is considered
for the _DEBUG entries, "Release" and "RelWithDebInfo" for _RELEASE.
The qt_lib_XXX_private.pri files are now generated in multiple steps:
1. The QT_LIBS_XXX information is generated per $<CONFIG> and written to
.cmake files.
2. A preliminary qt_lib_XXX_private.pri file is generated, containing
only configuration-independent data.
3. A custom command runs the QtGenerateLibPri.cmake script that combines
the files from step 1 and 2 into the final qt_lib_XXX_private.pri
file.
The same is done for mkspecs/qmodule.pri.
To be able to trigger custom commands from header modules, which are
interface libraries, we introduce one XXX_timestamp ALL target per
header module that creates a timestamp file. To that XXX_timestamp
target we add the pri file generation target as dependency.
Fixes: QTBUG-84348
Change-Id: I610f279e37feeb7eceb9ef20b3ddfecff8cfbf81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QString and QStringRef did bounds checking for left/right/mid, whereas
QStringView was asserting on out of bounds.
Relax the behavior for QStringView and do bounds checking on pos/n
as well. This removes a source of potentially hidden errors when porting
from QStringRef (or QString) to QStringView.
Unfortunately, one difference remains, where QByteArray::left/right()
behaves differently (and somewhat more sane) than QString and
QStringRef. We're keeping the difference here, as it has been around
for many years.
Mark left/right/mid as obsolete and to be replaced with the new
first/last/slice methods.
Change-Id: I18c203799ba78c928a4610a6038089f27696c22e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QPromise and QFuture created from it share the same internal state
(namely, QFutureInterface object). QPromise provides high-level
management of the shared resource, ensuring thread-safe behavior
on construction and destruction (also taking into account
QFuture::waitForFinished() semantics).
QFuture acts as a primary controller of QPromise via action
initiating methods such as suspend() or cancel(). QPromise is
equipped with methods to check the status, but the actual
handling of QFuture action "requests" is user-defined.
[ChangeLog][QtCore][QPromise] Added QPromise class to accompany
QFuture. It allows one to communicate computation results and
progress to the QFuture via a shared state.
Task-number: QTBUG-81586
Change-Id: Ibab9681d35fe63754bf394ad0e7923e2683e2457
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The Qt namespace was introduced in 461e89ee1a which is only since 5.14
Also remove QTextStreamFunctions:: from the documentation of the
deprecated functions since the QTextStreamFunctions namespace is a syntaxic workaround.
Pick-to: 5.15
Change-Id: I9c15bcc49984bf5f5099c2f7df6b8adb3d2c61fb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The module pri files of internal modules did not expose any include
paths. They must have both, the public and the private include paths.
Task-number: QTBUG-84781
Change-Id: I3cbe94d4e49c754e49d26b00012e668b0afbdc8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To avoid an incorrect offset for the native window, call create()
after createWindowContainer().
The mysterious -1 for the width and height are removed as well because
otherwise the GL window's size is clearly off by one.
Fixes: QTBUG-82195
Pick-to: 5.15
Change-Id: I1a9cec62746fc110bfc4cd2e4fa111f621124638
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Prevents buildup of autoreleased NSViews (drawables) in the outer pool
of the main runloop, which may not drain as often as we wish.
Change-Id: Ifcf7317c50ec243e0d957bf4a19aab8bf34d5dd6
Fixes: QTBUG-84762
Pick-to: 5.15 5.12
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This way the metatypes files are generated even if there are no
metatypes in the module. This is necessary in order to generate empty
QML modules, which in turn is useful if we only want e.g. URL
interceptors in a module, but not types.
Change-Id: Ief949cfebe831b69353a75d0da15ee347995051c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
MinGW plugins should not have the lib prefix in the shared library
names. Do this manually for a couple of libraries, and also for the
generic qt_add_cmake_library function.
Amends 9b0e23ef8a
Change-Id: I1cfaf8fc046f86edd3e755adfa599aa0aa854ee3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The trait is deprecated in C++17 and removed in C++20. Enforce
the same meaning by using a constexpr variable instead.
Change-Id: Ief13afc3f889af09094391e626037778d879c4f5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
And silence those warnings in code that emits those signals.
Change-Id: Ic9013648060c9b84b59c44bb5a8c77e48f82d24f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.
QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.
QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.
Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.
Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Many of these were generated by clazy using the new qevent-accessors check.
Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
...by deprecating everything that doesn't conform to the naming scheme,
and providing replacements. Continues what was started with QWheelEvent
in 7d29807296. However QMouseEvent::pos()
is left un-deprecated because it's so widely used.
Also quit returning QPointF by const-ref from accessors. It's plenty
small enough to return by value; we were never consistent about it anyway;
and it's good to avoid some problems with returning a reference to a
temporary in case the value is calculated in the accessor.
[ChangeLog][QtGui][QPointerEvent] Mouse, touch and tablet events now
have a standard set of QPointF accessors: position(), scenePosition()
and globalPosition(). Existing accessors that return integer QPoints,
and those with non-standard names, have been deprecated. You can use the
clazy qevent-accessors check to update your code accordingly.
Task-number: QTBUG-20885
Task-number: QTBUG-84775
Change-Id: I8e6f587da76d6d0bca6e965ce8ebc7e67b868011
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: I025504c7d22fb7a8c943e3968e4613d45c08d0b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is needed so that other repos other than qtbase (like qtopcua)
can still find_package(WrapOpenSSL) successfully.
The path needs to be converted to a CMake path, to avoid issues
on Windows with backslashes.
Change-Id: I3d7652d93110f6b8f39a58a6c28aef6c7471aea7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT might be empty on the
first configuration, but because QtBuildInternalsExtra sets the
CMAKE_INSTALL_PREFIX, a second reconfiguration of a test would
stop setting the fake install prefix.
After some further consideration, there's no need to set the local
fake prefix conditionally, we can always do it (unless explicitly
opted out).
This makes sure that a reconfiguration of a test doesn't suddenly
install into the Qt prefix again.
Amends 37b132cd4e
Task-number: QTBUG-84346
Change-Id: Ic61aefe18418658455d8cdb9ebe6bcbcb8d67c99
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The default font on Windows 10 (Segoe UI) will return the
wrong minimum right bearing at some sizes, which will cause
us to skip the textWidthVsWIdth() test at some scale factors,
since we cannot trust the layout to be perfect in this case.
Based on experiment, Arial is more accurate, so in order to
avoid skipping the test, we default to this on Windows instead.
(Note: The problem has not been observed with the default fonts
on Linux or macOS, so we only do this for Windows specifically.)
Task-number: QTBUG-84415
Pick-to: 5.15
Change-Id: I8cdb5d0d9922915a6ed1574d62a561dda0e1dc5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
They are not necessary, and they conflict with what qttools generates.
Fixes: QTBUG-82133
Change-Id: I4a1273d694626345b32b45c653dd31d3b78621eb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Safari on iOS now supports the Navigator.clipboard
API, but not the Navigator.permissions API.
Looks like we have not encountered this combination
Before. Add undefined check for permissions as well.
Fixes: QTBUG-84658
Pick-to: 5.15
Change-Id: I99ab08fd34bbb29a82661e24bf400c927f3604f6
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
- Set base URL path to /qt
- Define 'qt6' for use in conditionals
- Omit \since information for everything introduced
before Qt 5
- Make use of the new expandable variables to allow
component-specific URLs in commercial templates
- Adjust CSS for changes in QDoc's output
Change-Id: I74581f0fb49cd176f92d6451c388e7b7ddf1baa4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
It can be configured using the QFONTCACHE_MIN_COST
define when configuring Qt.
Change-Id: I41fb781099c4c0f03c378f10c8db4ea06ef4e9ff
Task-number: QTBUG-83127
Reviewed-by: Risto Avila <risto.avila@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
These methods are scheduled as a replacement for left/right/mid()
in Qt 6 with a consistent, narrow contract that does not allow
out of bounds indices, and therefore does permit faster
implementations.
Change-Id: Iabf22e8d4f3fef3c5e69a17f103e6cddebe420b1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
The code is the first user of the collected data, so make that
available by adding QDuplicateTracker::appendTo(Container&) methods.
Change-Id: Ibd8810c0070db7e6b3ead6d6a569facdab88b646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This should help visually differentiate between
the section titles and the normal text.
Change-Id: I5594aac0e0036509e7397999c3df21a90d474d60
Fixes: QTBUG-82694
Pick-to: 5.15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The seemingly useless template parameters are needed to avoid a
(distinct) bug in MSVC 2019 < 16.6, and should be removed once we have a
newer version in the CI.
Task-number: QTBUG-82945
Fixes: QTBUG-83600
Change-Id: I5b22a2259aa16ae90eca7d4f3bd2e4fa1116a73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This uses the "unneeded #include" approach, as this looks less
ugly than the QT_{BEGIN,END}_NAMESPACE decoration.
Change-Id: I03b6cf3ebf464134fe78ab49cbbad70c0b5fd42a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch makes the 'accesiblebridge' plugin configurable.
Change-Id: I99f01fcd434be25bbbe5460bbc8cc1d76aa744b9
Task-number: QTBUG-83126
Pick-to: 5.15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
There are some slight differences between normal drawText()
and QGlyphRuns/QStaticText for decoration widths in certain
fonts. We decided to accept this and tried working around it
in the test by using ForceIntegerMetrics (since the difference
is < 0.5 pixel). This enum has been deprecated, so we move
the tests into Lancelot instead, since the idea here is to
test for regressions, not to compare the two painter commands.
Note that there is something off about decorations with
drawGlyphRuns() and drawStaticText() which is exposed
(not caused) by this, perhaps related to using a matrix
for positioning, since that was untested before.
This also takes the liberty of moving the emoji test string
from text.qps, since this was not in the statictext.qps yet.
Change-Id: Ib2d697095cbd11829cdd50b3c0268c85e9607c78
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Pairs are easy to use, but they have no semantics attached: Two
QPair<QString, QString> compare equal, e.g., even though one is used
as a FontAndStyle and the other as, say, a type/subtype. It also
carries no information for the reader of the code.
So, write a minimal struct with equality and qHash() instead.
Change-Id: I9514c9b7d6c2cc6a4831f9ca83ca2ee466d91553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>