Added missing whitespace character in the documentation for QMdiArea,
in the 'detailed explanation' section.
Pick-to: 6.0
Change-Id: I6be1d664bc15e3e461c5fc3d8f82311cc6ea60ea
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
d8602ce58b removed the internal usage
of the singular fontDef.family, changing this to fontDef.families.first()
instead, which will assert if the families list is empty. To match
old behavior, we set the symbol flag to false if there is no family
name.
Change-Id: I594cf3dfa2798e60b37dc525c172fb2cd9aa7380
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
To be able to link a Release user project against a RelWithDebInfo Qt we
set several IMPORTED_*_RELEASE properties in
the *AdditionalTargetInfo.cmake file of each Qt module.
The EntryPoint module however is a bit special as it is an
INTERFACE_LIBRARY linking publicly against a static
library (EntryPointimplementation). Its *AdditionalTargetInfo.cmake file
was almost empty, because qt_internal_export_additional_targets_file was
called before EntryPointImplementation was set up. Also,
qt_internal_add_module, which calls
qt_internal_export_additional_targets_file, does not know that we want
to export the EntryPointImplementation target.
We fix this by telling qt_internal_add_module(EntryPoint) to not
generate the *AdditionalTargetInfo.cmake file and call
qt_internal_export_additional_targets_file later to take the targets
EntryPoint and EntryPointImplementation into consideration.
qt_internal_add_module learned the option NO_ADDITIONAL_TARGET_INFO to
turn off the generation of *AdditionalTargetInfo.cmake files.
Pick-to: 6.0
Fixes: QTBUG-90039
Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Instead, have a static function in QRhiVulkanInitParams then Qt Quick
and anyone else who creates a QVulkanInstance that is then used in
combination with QRhi can query.
Change-Id: I046e0d84541fc00f5487a7527c97be262221527f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...as described in the Vulkan >= 1.1 spec. One can now call
supportedApiVersion() (before create(), similarly to the other
supported* functions) to determine the available Vulkan
(instance-level) version.
Fixes: QTBUG-90333
Change-Id: Ibe8482402b7f07e4abc48c88252ff0365e4e2faa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
My guess: it was relocatable because before 6.0/5.15 we didn't
call constructors for Q_PRIMITIVE_TYPEs.
Change-Id: Ibc9e23e41d0c4b9718fc7036d9a647cfdcfa7d47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Moving sections in RTL mode did not work correctly - in contrast to LTR
mode the secion must be moved much further to the left or right to
actually move it.
Found while implementing an indicator for QTBUG-673
Task-number: QTBUG-673
Change-Id: I5a82d3cdb39415a408b2884d0ee302e0547e884f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
They have been reported wrong since Qt 4, and not fixed for behavior
compatibility, fixing it for Qt 6.
[ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names
and X11 names match, instead of being 2 off.
Pick-to: 6.0
Fixes: QTBUG-25261
Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
The generic functions are better optimized anyway, and it this old
method appears to have old bugs.
Fixes: QTBUG-20681
Change-Id: I60e4cc5f6cd90c851e90106ac9badfc6c249cd9f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
When writing out a float value, the output string is encoded as QVariant
for no reason. Looks like an oversight when QMetaType::Float was added a
long time ago.
Fixes: QTBUG-21156
Change-Id: I7f5d31e15892d700c1b1e5e731b7733ce3a15730
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add an enumeration for system-out and alog element
for it. Redirect the messages types that are not warnings/errors
to this element. For compatibility, write it out only
if it is not empty. Rename enumerations and members accordingly.
[ChangeLog][QtTestLib] In JUnit XML, output that is
not a warning/error is now logged under <system-out>
instead of <system-err>.
Fixes: QTBUG-86540
Change-Id: I55598eafa7dafa486ac5a8221029c332ff47413b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A resize event delivered after closing the platform window
was causing the stored frame margins to be cleared.
Bail out of QWidgetWindow::updateMargins() if the
platform window is null.
Pick-to: 5.15
Fixes: QTBUG-79147
Change-Id: Iebbc90c3cccafa209cd720baedf45affb3f3c2b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The native NSSavePanel does not have an option corresponding
to DontConfirmOverwrite. Qt has a workaround where
the save-file-name is temporarily given a prefix in
order do bypass the overwrite check, however this has
stopped working on recent versions of macOS. (Confirmed
on macOS 11)
Users who want to use DontConfirmOverwrite should use
Qt’s file dialog instead.
Fixes: QTBUG-39791
Pick-to: 5.15 6.0
Change-Id: Id3b9e6de72c2afc9526c96f1d9fdbce78db92aeb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
[ChangeLog][QtCore] qIsInf(), qIsNaN() and qIsFinite() now, like
std::isinf() and friends, accept integral types (returning false,
false and true, respectively) as well as floating-point ones.
Change-Id: I1e2b7f033f0e8166c0b21e31a62b3e6d37b9344a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When setting the application's focus widget we search for the next
child widget that can hold the focus and call its setFocus() method,
which also updates focus widgets of all its parent wigets.
In case if the focus widget is the active window itself, we only set it
as the application's focus widget, but we don't update the focus widget
of the active window itself. Because of this the focusWidget() method
always results nullptr for the active window. This prevents from setting
the focus back to active window after the focus has changed (for example
after a context menu is closed, as in the bugreport).
Transfer the focus to active window by calling the setFocus() method, as
it is done in case of transferring the focus to any other widget.
Pick-to: 6.0 5.15
Fixes: QTBUG-85846
Change-Id: I91ebf182fd5bb7d451a1186e2f3e38c8d48acc4e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Otherwise we end up with generating broken qvulkanfunctions cpp and h
files.
For example, encountering the following command element should lead to
taking no action, this is not something we want to emit a corresponding
wrapper function for:
<command name="vkResetQueryPoolEXT" alias="vkResetQueryPool"/>
This is required to be able to upgrade the bundled vk.xml to something
newer.
Fixes: QTBUG-90330
Task-number: QTBUG-90219
Change-Id: Ie6e3a8794207e30a172820eb055238bf52a0c0b9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The input has been fetch into a set of uint32s, so no longer a
string of ushorts.
Pick-to: 6.0 5.15
Fixes: QTBUG-90246
Change-Id: Id52a6824317b0744310008cc2ce2f726539b4c8c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Functions in QtFlagHandlingHelpers.cmake try to update the CMake cache
variables for compiler and linker flags. These were using the current
value of those variables and writing the modified ones back to the
cache every time CMake ran. If a toolchain file sets or modifies any of
these variables, that updated value is used and written back into the
cache instead of the original cache variable's value. The next time
CMake executes, the toolchain file re-applies the same change and the
variable grows longer each time with flags repeated. With Ninja, this
causes a complete rebuild every time CMake is re-run. The Android NDK
toolchain file is one example where this behavior is triggered (the
fault is shared, one could argue that the NDK should only be setting
..._INIT variables, but that's out of our control).
Another related bug in the previous implementation was that the flags
used to build after the first CMake execution could be different to
those used for all builds after the second and later CMake runs. This
is because the CMake cache was being updated, but not always the
calling scope of the functions that modified them. If a toolchain file
set any of the compiler or linker flag variables as non-cache
variables, then updating the cache variable would have no effect on
the calling scope. The non-cache variable would continue to take
precedence for that scope for that run. The next time CMake executes
though, the updated cache variable would now have been used by the
toolchain file and the change *will* be part of the non-cache
variable's value.
The above are examples of why you should try to avoid updating these
cache variables from project code. We could leave the cache alone and
always update only non-cache variables, but then a developer looking
at the cache may wonder why the values they see there don't match the
values being used in builds. Or worse, they think the cache values
are being used and don't realize the builds are using something
different. Ultimately, we have to choose which downside we are happy
to live with. The changes here preserve the previous intent of
updating the cache, but it's still a bit fragile.
Fixes: QTBUG-89821
Task-number: QTBUG-85992
Task-number: QTBUG-86866
Change-Id: I8a16753e159bde338e6d2e5dd2ce91fc8ac5c39d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In this case, the previous action's tip is still displayed
when the cursor moves from one action with tip to another action
without tip.
Fixes: QTBUG-89082
Pick-to: 5.15
Pick-to: 6.0
Change-Id: I0a00595dc3d716725678487be9cbb363c4d3b392
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If a default font was not registered for the widget's class, it returns the default font of its nearest registered superclass.
Fixes: QTBUG-89910
Pick-to: 5.15 6.0
Change-Id: I6e6b2c6a0044462f84db9f76a03be0c6cfaaae8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
To enable the current Qt version to use a qt.conf that is independent
from the previous version, a file named 'qt<major-version>.conf' is
searched for first. If this file does not exist, a file with the
name 'qt.conf' is searched for.
Task-number: QTBUG-88635
Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
setTabOrder was not considering the case, when a child widget has
its focus proxy set to its parent widget. This happens, for example,
for the QLineEdit that is nested inside the QAbstractSpinBox.
For such cases the lastFocusChild was calculated incorrectly, and, as
a result, such child widgets were not correctly positioned in the
focus chain. This could lead to an error while backtabbing.
Here is a brief example. Suppose we have 3 widgets arranged like this:
auto spinBoxOne = new QDoubleSpinBox;
auto spinBoxTwo = new QDoubleSpinBox;
auto button = new QPushButton;
Then the default widget focus order is:
- spinBoxOne
- lineedit (from spinBoxOne)
- spinBoxTwo
- lineedit (from spinBoxTwo)
- button
Before this commit setting the explicit tab order changed the focus
order in the following way:
QWidget::setTabOrder(spinBoxOne, spinBoxTwo);
QWidget::setTabOrder(spinBoxTwo, button);
- spinBoxOne
- spinBoxTwo
- button
- lineedit (from spinBoxOne)
- lineedit (from spinBoxTwo)
In this case, backtabbing from spinBoxOne actually leads us to
lineedit (from spinBoxTwo), which refers to spinBoxTwo.
And so we're stuck in a loop.
This commit fixes the issue by handling such special case, and
preserving correct focus order.
Note: the actual unit-test in this patch uses QLineEdit instead of
QPushButton, because one can't tab to buttons on macOS by default.
However the general idea is the same.
Pick-to: 6.0 5.15
Fixes: QTBUG-81097
Change-Id: I5d16da7733a4d63f809cab28b8ca9e116b87cffa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QGuiApplicationPrivate::processMouseEvent() sends a
QWindowSystemInterfacePrivate::TouchEvent if the mouse event is not
accepted and AA_SynthesizeTouchForUnhandledMouseEvents is enabled.
A QPA TouchEvent always contains native touch points, which is why
it calls QWindowSystemInterfacePrivate::fromNativeTouchPoints to
translate the QMouseEvent's device-independent position back to the
raw position that it would have had if it came from a real touchscreen.
Therefore we must give that function touchpoints that are actually in
native coordinates.
It may be that some of this transformation could be avoided entirely,
but here we prove that the existing way works correctly, by adding
coordinate checking to the tst_QWindow::mouseToTouchTranslation() test.
Pick-to: 6.0
Task-number: QTBUG-86165
Change-Id: I4c9ca2b11e9eb76d79712c187db3eb9865da581a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The fusion style did ignore the QIcon::On icon because it reset State_On
to avoid the visual shift of a pressed button.
But it's not needed to reset this flag - the shift does not happen
because the fusion style does return 0 as offset for
PM_ButtonShiftHorizontal/PM_ButtonShiftVertical so no shifting will
happen.
Fixes: QTBUG-86736
Fixes: QTBUG-82110
Change-Id: Ie2aaddb14bc67874f5a9a23d9f04d7a08c6d070f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
One table per color channel, as is possible from many inputs.
Change-Id: I9fc723c68f222a228dd2b1458207b028422913bf
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The delta was clearly intended to be used on the total (and still is)
but it also wound up getting stored in the cache, which wouldn't be a
big problem unless the object was removed, in which case we could
incidentally 'free up more space' than intended.
Pick-to: 6.0
Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
In the readFromInotify() function, add a check whether
the ioctl function is successful or not. In the case of
failure, continuing to execute the following code would cause
errors in the read function because there is no data in the buffer.
Change-Id: Id53037e9e48c97c9eb75835048143875275b6370
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Some ODBC drivers do not properly handle SQL_NO_DATA and therefore
decimal values returned with HighPrecision are cut off because the
decimal point is not taken into account.
Fixes: QTBUG-73286
Pick-to: 6.0 5.15 5.12
Change-Id: I905c947b4d0266a3245d5735300300ca00f77480
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Currently there is no way to get the name of the current style to e.g.
create a QProxyStyle for a specific widget only.
Therefore add QStyle::name() so QProxyStyle(const QString &) can be
called without hard-coding the style name.
Remove an unused doc snippet as drive-by.
Fixes: QTBUG-8004
Change-Id: I466c5e870a5392b238365bdc930f6a2ecee50cdb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Pass the right from depth to the conversion function, and
set the right format before creating the compositor image
for RGB16 support.
Pick-to: 6.0 5.15
Fixes: QTBUG-85621
Change-Id: I76f46a3c2d8f1d2b040b790035dbdb0a960ff1a7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
For Qt Widgets we thought it was a good idea to also store in the cache
if a class didn't have a factory plugin. This worked fine there, since
the number of QWidget classnames is quite limited (so the factory plugin
cache will soon reach a limit)
In QML however, classes are often suffixed with e.g. Button_QMLTYPE_123,
Button_QMLTYPE_124 etc.
This number suffix is just increased continuously. This could lead to that
the factory plugin cache will grow ad infinitum, which will cause
"memory leaks" in addition to a performance penalty.
Pick-to: 6.0
Pick-to: 5.15
Fixes: QTBUG-75106
Change-Id: I9ba189f989f0b90ab62a2c54a2e9230236a998d8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The porting script could not handle this special case.
To achieve the same thing, we'll use an intermediate 'OBJECT' library
which will get the '-fno-lto' build flag if the conditions are met.
Fixes: QTBUG-89426
Pick-to: 6.0
Change-Id: Ied62502ce9c7f7fd6b89fab166f7bccfcd6e7433
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When the QComboBox gets a custom view with multiple columns, only the
first one is selected even the selection mode of the view is SelectRows.
The selection changes afterwards properly honor the mode though.
Therefore check for the selection mode and call setCurrentIndex() with
the appropriate flags.
Fixes: QTBUG-86776
Pick-to: 6.0
Pick-to: 5.15
Change-Id: Ieba7b9e009358e7b6e802b7847640161ec776c64
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Was implemented for QLineEdit but not QTextEdit.
Fixes: QTBUG-83056
Pick-to: 6.0 5.15
Change-Id: I1e67ad0f1c230a062a1e12e8bc0b209c5289dc32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The width of the combobox took the space for the checkmark and the contents
into account, but didn't provide any padding on the right side, resulting
in the text hitting the right side of the combobox popup.
Add another 12 pixels padding to the sizeFromContents implementation,
which results in a symmetrical padding on both sides of the text.
Fixes: QTBUG-88715
Pick-to: 6.0 5.15
Change-Id: I811da73d11ce935c1fb83efabbe799f9a882e1d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Turn the warning into a qCDebug() statement and add explanatory comment.
Fixes: QTBUG-85683
Pick-to: 5.15 6.0
Change-Id: I2a6a7a089a660294f3e9c3096299c75635b3b215
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
From QRhi's perspective this consists of two things:
- A shader with samplerExternalOES in it cannot go through the standard
pipeline. Rather, a QShader with suitable GLSL code in it has to be
constructed manually. As this is something useful as an autotest
anyway, add a test case to the qshader autotest that demonstrates
this.
- When it comes to correctly calling glBindTexture, add a QRhiTexture
flag. The expectation is that an OpenGL-only client sets this in
combination with QRhiTexture::createFrom(), thus wrapping an existing
texture that then gets bound to the GL_TEXTURE_EXTERNAL_OES target
instead of our usual GL_TEXTURE_2D.
For completeness we also add a SamplerExternalOES variable type to
QShaderDescription, but the sampler type is not actually used by the
QRhi OpenGL backend, as it is the QRhiTexture that defines the
texture target.
Change-Id: I36b52325deb3703b59186ee3d726d0c3015bfc4b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...to the extent it is sensible. We have to make compromises still,
meaning some fields will only be applicable with certain APIs.
Most of this is already shown upon QRhi::create() as info debug
prints, when enabled. Now expose it all through the QRhi API as
well.
This is useful for printing in qtdiag, and, while it should be
avoided as much as possible, to make decisions about disabling
3D rendering features depending on the driver and GPU in use.
Change-Id: Iebe1e192965c928b82a094d1c7c50ddf4b38b9a2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Those serve no purpose anymore, now that the .pro files are gone.
Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
The color should be used across the board, so the PlaceholderText color
should also be respecting the one passed for Text and so on.
Fixes: QTBUG-89815
Pick-to: 6.0 5.15
Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Doing so results in a warning about "modalSession has been exited
prematurely - check for a reentrant call to endModalSession:", and
on Big Sur will also result in the file failing to save because the
return code from runModal will no longer be NSModalResponseOK.
This would happen when the completion handler for beginSheetModalForWindow
would call QNSOpenSavePanelDelegate_panelClosed, resulting in calls to
QDialog::done(), which in turn tries to hide the dialog, via
QCocoaFileDialogHelper::hideCocoaFilePanel().
Pick-to: 6.0 5.15
Fixes: QTBUG-89959
Change-Id: I048afe3dcc7fe62e0d0273f12b4b2c0237abb052
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QTextDocument and the text editor classes suggest to override
their loadResource() methods to provide data associated with
a text document. This approach has the following drawbacks:
- it requires subclassing
- there is no way to set a global resource provider
- QLabel is missing virtual loadResource() method and
it can't be added without breaking ABI
QUrlResourceProvider is designed to solve these issues.
One should create a derived class that implements
QUrlResourceProvider::resource(). The objects of the derived
class then can be set for any text document.
The default resource provider can be set with
QUrlResourceProvider::setDefaultProvider().
This change also adds QLabel::setResourceProvider(),
which doesn't break ABI.
[ChangeLog][QtGui][Text] Introduced QUrlResourceProvider that allows to
load resources for HTML. It is intended to replace the use of
QTextDocument::loadResource().
Change-Id: Iaf19b229f522a73508f20715257450fe58f68daf
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Per the discussion of QTBUG-88831, we determined that module-wide
imports are unfortunate, especially for compile times. Following this,
all QtDBus includes have been replaced with the headers for the classes
actually used in each file. Additionally, some cleanup of header file
order and format has been performed in the changed files.
Pick-to: 6.0
Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When we add text to QPainterPath, we will add the design metrics
(unhinted glyphs) and scale these down to match the target font size.
But the glyph positions we pass in are based on the hinted metrics,
samples at the target font size. Thus, on fonts/systems with hinting,
these do not match the scaled design metrics outlines.
To fix this issue, we make sure the text layout uses design metrics
when determining the glyph positions.
[ChangeLog][QtGui][Text] Fixed an issue where QPainterPath::addText()
would get inconsistent kerning for smaller font sizes when hinting is
enabled.
Fixes: QTBUG-20900
Pick-to: 5.15
Pick-to: 6.0
Change-Id: I651997d1a6a86e6271557438afa2cdad078a83ca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Make sure the search start with valid values.
Pick-to: 6.0 5.15
Task-number: QTBUG-89354
Change-Id: I5b5100db89c62f23748b5c88e9188cfe3811e6e8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
SQlite allows to return fine-granulated error codes but this behavior is
not enabled by default (due to backwards compatibility concerns).
Enable them for the SQLite driver by default but provide an option to
disable them when needed.
[ChangeLog][QtSql][QSQLITE] The plugin now returns the extended error
codes by default.
Change-Id: I59cec9aea46eb03f1e7ca02903d769c003a1ae30
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
In QPropertyObserverPointer::notify and its calling sites,
variable names "alreadyKnownToHaveChanged",
"knownIfPropertyChanged", "propertyChanged", and at its calling site
"knownIfChanged" are used. This is confusing. This patch
changes those four to "knownToHaveChanged". For the logic
implemented it is not necessary to track whether we
have knowledge about having changed and whether it has
actually changed (if we have knowledge) separately.
Change-Id: I90b86b276ab67b2ed70dba4e456cd90220588870
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If we create a QBindable from a const property, we should obtain a
read-only interface. Besides implementing this feature, this patch adds
a isReadOnly method to Q(Untyped)Bindable which can be used to check
whether one can modify the property via the bindable interface.
Task-number: QTBUG-89505
Task-number: QTBUG-89469
Change-Id: Ic36949a5b84c5119e0060ed0a1cf4ac94a66f341
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This reverts commit a81dfb32d6.
Paint immediately on WM_PAINT in all cases in order to
avoid flicker on resize.
The cases mentioned in commit a81dfb should no longer
apply:
- QTBUG-38327: QGLWidget is not supported in Qt 6.
- QTBUG-39842: Fixed by using ExcludeUserInputEvents.
Fixes: QTBUG-89688
Change-Id: If82cf7703d6663982769048e86a7060223730ce7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The snippets do not talk about Qt Widgets specifically.
Pick-to: 6.0 5.15
Change-Id: Icc4f243c93189f08124074e4918d535aa37e6560
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reflow text to fit style while at it, to satisfy git clang-format.
Pick-to: 6.0 5.15
Fixes: QTBUG-89709
Change-Id: Iab2bf09399adf2cb0f0219ab40978bb238825ae8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
There are still other parts of the CMake API that are not yet
documented. This change only addresses qt_add_executable() and the
Android-related commands it uses.
Fixes: QTBUG-88839
Task-number: QTBUG-84482
Pick-to: 6.0
Change-Id: I761b5ce908d1f62284baabe2d414cd37a0efe83d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This patch adds native support for SQL_REAL (float) and SQL_SMALLINT
(short). Previously those datatypes were mapped to double and integer.
[ChangeLog][QtSql] The ODBC driver now properly maps QMetaType::Float to
real sql datatype and QMetaType::Short to smallint
Fixes: QTBUG-8963
Fixes: QTBUG-57279
Change-Id: Ifec4c609734dbe6165c1ebdadb461c2aae47ba78
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
To avoid the mostly hypothetical possibility of failure, delete the
processFinishedNotifier before closing the handle on which it operates.
Previously, because of this, we explicitly disabled the notifier in the
processFinished() function, which made the code unclear. Now, we can
remove that safely, because cleanup() works correctly, and doing it
before calling findExitCode() was not necessary to start with.
Change-Id: Ia7095ded2c7eba8f4d738c6b87c7be41aa3cbbc8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
if pid == nullptr, the child process has already exited and the pipe
readers have been stopped. So the call to drainOutputPipes() is
unnecessary here.
Change-Id: I0bed90d08ac879bb0ae178a1cdc37afb9d825314
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Otherwise, the user may receive the readyRead() signal just before
started().
Change-Id: I8d6fd18fdfcef0580a3e609100198b03b18b1175
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The completion of the child process can take place asynchronously or in
one of the waitFor...() functions. In both cases, we used the same
handler (_q_processDied()), which caused several problems:
a. technically, waitForReadyRead() should have taken into account the
result of the calls to _q_canRead...() slots inside the
_q_processDied() function:
- the user calls waitForReadyRead();
- forkfd descriptor becomes signaled, while a grandchild
process is still alive;
- as readyRead() signal has not been emitted, _q_processDied()
is called;
- the grandchild process writes to stdout pipe;
- now data arrives, and _q_processDied() will collect it, but
won't report it.
b. we had a bug with recursions on Unix:
- death notification comes asynchronously;
- waitForDeadChild() closes forkfd;
- _q_canRead...() emits readyRead();
- a slot connected to readyRead() calls waitForFinished();
- waitForFinished() hangs (forkfd == -1).
c. for blocking functions, drainOutputPipes() was called twice on
Windows.
By introducing a new processFinished() function, we leave the read
operations in the _q_processDied() slot, while the process completion
code is guaranteed to run only once.
Change-Id: I5f9d09bc68a058169de4d9e490b48fc0b35e94cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The container size change from int32_t to int64_t created a subtle error
during font serialization. The size of a QByteArray was serialized
without a proper cast and therefore now 8 bytes instead 4 bytes were
written to the stream.
Fixes: QTBUG-89727
Pick-to: 6.0
Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
In construction of QPropertyBindingPrivate was an initialization
of inlineDependencyObservers with a comment that this is necessary
because of a union. But inlineDependencyObservers is not inside a
union. The comment is outdated and the explicit initialization
superfluous. This patch removes it.
Change-Id: I06544a816533c41af8fc5da3ef44ddd7c18ca86e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is an addendum to commit 0da5726a43b; making the note about paths
starting with ':' being treated as absolute paths by the underlying
QFileSystemEngine, more visible, so that users of the class don't hit
that pitfall.
Add similar docs to QFileInfo.
Pick-to: 5.15 6.0
Change-Id: Ib34d066d31bb673d340ec41422ed4daf911765b8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Speculative fix to get the right keys in WebEngine
Pick-to: 6.0 5.15
Fixes: QTBUG-89915
Change-Id: I79519b715a1415dccfc4601aae5025b3222a79ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Remove the logic compressing WM_DISPLAYCHANGE signals by the
WParam/LParam since it also triggers when the geometry is changed
by rearranging screens.
Fixes: QTBUG-79442
Change-Id: I00042c9e687bdb67fc17d6c507818b79a7aee0a2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
There is no reason to have the startup notifier and the death notifier
be active at the same time, as the former will detect death as well.
Previously, these notifiers were racing, but _q_processDied() ordered
signals by calling _q_startupNotification() manually. Thus, the
started()/finished() sequence was always emitted if the child process
was killed anywhere. Now this ordering is simply not necessary anymore.
This makes it possible to reuse the startup notifier for death
notification.
Change-Id: I5ebed9b5f28b19fe56c80498977a3b21be9288fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This is assumed in various places, so best checked explicitly.
Change-Id: I475dcf5cbb60c0272dec560acd2893cff73872ce
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We should use char32_t for the toUcs4() methods of QString and
QStringView and use char16_t for QString::utf16(), thereby matching
QStringView. These naturally imply knock-on changes in various places.
Unfortunately, we didn't make those changes in Qt 6, so they'll have
to wait for Qt 7.
Change-Id: I18451d4b31b76658092e19d3fcbc8bc0fe5ce307
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones.
Follow-up to 50e1976437.
Task-number: QTBUG-85520
Pick-to: 6.0
Change-Id: I138f0775d9804029f2ecd6bd3594ab47b247392e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This reverts commit 09ee4282e5.
The commit made the layouting time go from linear to quadratic, which is
problematic when rendering big documents impractical.
I wrote an alternative fix for QTBUG-20354 which will come as separate
change since it approaches the problem in a different way.
Fixes: QTBUG-89599
Task-number: QTBUG-20354
Pick-to: 5.15
Pick-to: 6.0
Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Remove the qmake project files for most of Qt.
Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.
Also leave the qmake project files for utils and other minor parts that
lack CMake project files.
Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
d25589e052 mistakenly changed the code
to use toString() from the QTest namespace. Call toString()
unqualified and move the compareSequence() helper out of the
internal namespace.
Fixes: QTBUG-89737
Pick-to: 6.0
Change-Id: I8452a0aead7771ad13a5b95438b54e202ccce76b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit remove old legacy code that try to deal with clipboard
image conversion in the qwindowsmime class. It now uses
qbmphandler under the hood which is much more complete.
It also add a small fix for the conversion
of BI_RGB clipboard image with an explicit alpha layer (which Firefox
use on Windows).
Change-Id: Iae026378831799dc676e1aba7d5bd6a0d1c01e7f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QApplication tries to close all windows on quit using closeAllWindows,
but closeAllWindows skips windows that are already closing. This can
happen when calling quit() from a close event for example.
QApplication then tries to verify that all windows have been closed,
and that logic should skip the same kind of windows as closeAllWindows
does.
The fact that these two logics diverge was identified earlier in
5af73cd9db, but aligning them required further work. As that
commit notes, the right fix to align them is building on top of
tryCloseAllWidgetWindows(), which already returns true/false based on
whether it could close all windows or not. But, unlike the existing
logic in QApplication::event(), it doesn't skip Popups or Dialogs,
so that discrepancy needs further research.
Pick-to: 6.0
Fixes: QTBUG-89580
Change-Id: I87bff56f2eb8a539f1c859c957f5f239dc1eb93d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As lists of QStrings and QByteArrays are sequentially iterable the base
types should really also be.
The only problem is that they don't have methods to remove items from
the back or the front, but that is well within what we can support with
QSequentialIterable.
Change-Id: I2ab551e7b11a092aba363fb4012d131bbc4b11b4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Make it clear that the fast lookup is by key, not by value.
See also discussion in
https://forum.qt.io/topic/121907/misleading-documentation-of-qhash-qmap/
Pick-to: 5.15 6.0
Change-Id: I396297e0e4674e0a1f889f4138ab52ff224c0ee2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
When AA_ShareOpenGLContexts is not set, docking or undocking
will lead to changing the associated top-level window. This
leads to changing the OpenGL context, and tearing down and
then recreating all OpenGL resources (assuming a well written
application). The problem is, there are no paint events after
the Show, meaning the user code's paintGL is often not invoked,
which leads to showing an empty QOpenGLWidget until something
else triggers a paint event. To remedy this, send a paint event
upon Show, which should be harmless enough, while fixing the
case of docking/undocking.
Pick-to: 6.0 5.15
Fixes: QTBUG-89812
Change-Id: I3c4560f8f069d86645a6314bf7ad1b4ee8e2c716
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...when a QVkRenderBuffer is used as depth-stencil (i.e. a "throwaway"
depth-stencil buffer that is a lazily allocated / transient VkImage
under the hood). Such a resource is not tracked by the
QRhiPassResourceTracker, so do an explicit barrier in beginPass
instead of having it generated by the tracker.
Fixes: QTBUG-89764
Change-Id: Ice794f44342175f712ea56f450270cbb8929f516
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...encountered in the command list.
Move all, previously local, tracking variables into a struct. This
allows creating helper functions to reduce error-prone repetition in the
executeCommandBuffer() function body.
The only real change in the patch is in the handling of
Command::BufferSubData and Command::GetBufferSubData: here, instead of
calling glBindBuffer directly, use a helper function that also resets
the relevant state tracking variables. A subsequent
Command::BindVertexBuffer or BindIndexBuffer will therefore correctly
rebind the appropriate buffers.
This is particularly relevant with certain command stream patterns
exercised by some Qt Quick 3D scenes:
- A View3D renders a mesh,
- another View3D has some 2D Qt Quick content, as well as a model with
the same mesh.
When both View3Ds use the default Offscreen render mode, the resulting
command list consists of segments along the lines of:
1. prepare resources for first View3D
2. render content for first View3D - this binds the vertex and index
buffers for the mesh (state is tracked; all 1-4 steps are within
the same command list, processed by a single call to
executeCommandBuffer())
3. prepare the content for the "inline" 2D Qt Quick scene - this may
update vertex and index buffers, that may lead to adding
BufferSubData commands to the list (tracked state (last
vertex/index buffer) may need invalidation/updating - and that's
where our problem lies)
4. the second View3Ds 3D content is rendered: a model with the same
mesh as the last (Quick)3D draw call, so same vertex and index
buffers. If #3 did not invalidate and/or update the tracked state,
the glBindBuffer calls are (incorrectly) skipped.
Fixes: QTBUG-89780
Pick-to: 6.0
Change-Id: Icc933252f3993b8727d192e7ba4aa0f842bab51e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
There was a check "if (cd && cd->signalVectorCount())" in the code
which was faulty because "signalVectorCount()" could return -1 to
indicate that no signalVector is available. This patch fixes
the problem.
Fixes: QTBUG-89846
Pick-to: 5.15
Change-Id: I12c512ff8d889ba2bd298789ab6081930f739089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The code using it got removed in qttools commit 01da5d9a
Change-Id: I14d36ac939f2647139fcc42591a044a03e707553
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We did set this variable, however after src/gui/configure.cmake
was loaded (it is early-loaded in src/CMakeLists.txt), meaning the
assignment had no effect.
Also, what this assignment tried to achieve is covered by our global
CMake policies now.
Pick-to: 6.0
Task-number: QTBUG-89754
Change-Id: Ie7aeee1505d112d799455b2915acbfa7e9a12a64
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The qt6_android_generate_deployment_settings() command had been
creating deployment settings files with the wrong key name for qml
import paths. This resulted in the QT_QML_IMPORT_PATH target property
having no effect.
The QT_QML_IMPORT_PATH property can also potentially hold a list, not
just a single value. This change now handles the list case as well,
previously qt6_android_generate_deployment_settings() was assuming it
always held a single path if it was set.
Fixes: QTBUG-89628
Pick-to: 6.0
Change-Id: Ibdd74ec8d130f160433a60a14a0a9f496f496a1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QMultiHash::equal_range crashes when called in a const member function.
The Data `d` is a NULL pointer when calling equal_range()
before inserting data into an empty QMultiHash.
Then calling`d->find` crashes.
Fixes: QTBUG-89687
Pick-to: 6.0
Change-Id: I10c3d196cbc72aed8c8c922ef16534bba51037b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
There is no need to disable startupSocketNotifier because the call to
QProcessPrivate::processStarted() will do that.
Change-Id: I20b816533d9a5c4b9bf57135d26166c961a07d07
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
If there is an editor in the table then this needs to be updated as
the resize happens, otherwise it will not adapt to the new size
correctly and can appear drawn over other cells.
Fixes: QTBUG-85484
Pick-to: 5.15 6.0
Change-Id: I918c37f1ee1b0614c03c6b38f95f0f8b35a571f2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
The spec hasn't changed, but I made the same mistake in xdgmime
(the reference implementation) and in Qt: when multiple globs match,
and the result from magic sniffing is unrelated to any of those globs,
then I used the magic result, but that's wrong, globs have priority
and one of them should be picked up.
This is now fixed in xdgmime
(https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3)
and in the expected results in shared-mime-info
(https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/99)
which this commit is also tested against.
This change also optimizes QMimeBinaryProvider::addFileNameMatches
to have the same logic as xdgmime for glob matching:
literals > extensions > other globs
As soon as one category matches, we can stop there.
This makes no difference in the overall results, in practice.
The user bug report (against the Qt implementation, actually)
is https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/138
as well as https://bugs.kde.org/show_bug.cgi?id=411718
Pick-to: 6.0 5.15
Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Previously it only worked when isNull() was false, which is true for
very short lines, even though length() may be non-zero.
[ChangeLog][QtCore][QLineF] QLineF::setLength() will now set the
length if the line's length() is non-zero. Previously, it was
documented to only set the length if isNull() was false; this is a
fuzzy check, so isNull() could be true for a line with non-zero
length().
Fixes: QTBUG-89569
Pick-to: 6.0 5.15
Change-Id: I803e622ad09c85815dde25df8dd3ba6dfcba0714
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
An invalid (as input data) certificate may have non-zero number of invalid (nullptr)
extensions (if OpenSSL failed to parse them, for example).
Fixes: QTBUG-89547
Pick-to: 6.0 5.15 5.12
Change-Id: I4b93ac9f482f850f02d01b0aea10560dc11b688d
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
The default value is 'DontShowIndicatorWhenChildless' and not
'ShowForChildren'.
Fixes: QTBUG-83648
Pick-to: 6.0
Pick-to: 5.15
Change-Id: I5d4dd9f3f58bcac09ed38d8ae451e3b771695ce7
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
QAbstractItemView::selectionCommand() returned the wrong SelectionFlags
when no event is given since c4366ff018.
Therefore re-add the call to QGuiApplication::keyboardModifiers() when
no event is given and add a unittest for them so it's not removed again.
Fixes: QTBUG-89711
Change-Id: I107357df08c4ff1b1a14d49523401c5e7b428f56
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This attempts to reconcile a minor difference between Qt 5 and Qt 6:
Running Qt Quick applications with a platform plugin such as vnc,
led to an automatic fallback to the 'software' backend based on
the OpenGL capability reported from the platform plugin. In Qt 6.0
this logic is gone from Qt Quick, because we do not have, and wish
not to have, individual flags for each and every 3D API on this
level.
Therefore in Qt 6.0 a Qt Quick application running with the vnc
(or linuxfb, or minimal) platform needs an explicit selection of
the software backend via QT_QUICK_BACKEND or
QQuickWindow::setGraphicsApi().
To keep migration for users of such platform plugins easier, we
can still reintroduce a Qt 5-like logic: by having a high level
Is-QRhi-Supported type of flag, we can make Qt Quick query that,
and trigger the fallback to the software backend when it is
reported as false by the platform plugin. As this is the minority
case and a conscious choice by platform plugins, the flag can be
opt-out (i.e. true by the default hasCapability implementation).
When it comes to the existing OpenGL flag, that needs to stay for
compatibility reasons, but it is worth noting that the new flag
semantically falls in the exact same category: it does not indicate
things will really work at run time, but rather serves as an opt-out,
"do not even try" type of declaration the platform plugin can make,
which then allows modules like Qt Quick to make early, upfront
decisions about which rendering paths/backends to take.
Change-Id: I8d6fddeb82ca6eece7b7abc1a5b64ebe6d8af29d
Task-number: QTBUG-89561
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Take the logic we use in QRhi's Vulkan backend.
Pick-to: 6.0 5.15
Fixes: QTBUG-85791
Change-Id: Ifdc2b3d351af71fbc86e20abcede902303e41fc4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The only callers are QObject::findChild(ren), and they always
pass valid pointers, so there's no point of checking them.
Change-Id: I789abc3a53db523acf06c1a8a340094a71c79e41
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are no queries for this (somewhat dubious) flag in practice.
Its usage in Qt Quick is gone since 2014 after
0129887195c7255f41515f72ceb213a38b98f72d.
Change-Id: I4fd9cef2705ce13b79ff1dc40a6eda7ce2035e30
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Running with synchronization validation (SDK 1.2.154) we get:
Hazard WRITE_AFTER_WRITE vs. layout transition in subpass 0 for attachment 1
aspect depth during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR
Attempt to fix this with an appropriate subpass dependency.
Fixes: QTBUG-89760
Pick-to: 6.0
Change-Id: I67e15a09aab564f63aab646761ccdb1f8b82111d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Even though there is no D3D-specific logic in the windows platform
plugin, meaning a QWindow with either OpenGLSurface or VulkanSurface
(or anything really) is DXGI/D3D-compatible, it now looks like it is
beneficial, and more future proof, if there is a dedicated surface
type.
As the linked report shows, there are OpenGL-specific workarounds
accumulated in the platform plugin, while not being clear if these
are relevant to non-OpenGL content, or if they are relevant at all
still. (and some of these can be difficult/impossible to retest and
verify in practice)
When D3D-based windows use the same surface type, all these are
active for those windows as well, while Vulkan-based windows have
their own type and so some of these old workarounds are not active
for those. To reduce confusion, having a dedicated surface type for
D3D as well allows the logic to skip the old OpenGL workarounds,
giving us (and users) a more clear overall behavior when it comes
to OpenGL vs. Vulkan vs. D3D.
The change is compatible with any existing code in other modules
because any code that uses OpenGLSurface for D3D will continue to
work, using the new type can be introduced incrementally.
Task-number: QTBUG-89715
Change-Id: Ieba86a580bf5a3636730952184dc3a3ab7669b26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
qt_plugins target is needed by qt_internal_add_plugin function, but when
standalone building sqldrivers, this target does not exist, which causes
configure error. So we need to add this target manually.
Fixes: QTBUG-89714
Pick-to: 6.0
Change-Id: Ia7d613faabb82399c2f3e5771aab24302b3c8f56
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
View embedding when QWidget is involved is a bit finicky. This change
breaks down the steps needed to embed it into an NSMenu item, and
simplifies the process by not relying on a container widget.
The main issue is that QCocoaWindow::recreateWindowIfNeeded() will
potentially create an NSWindow for the embedded view, resulting in
a stray view. To prevent this we set the Qt::SubWindow flag on the
window, but QWidget tends to reset this flag when the widget doesn't
have a parent, so we need to be careful about which order we do the
setup.
Pick-to: 6.0 5.15
Change-Id: I505f7c0a2d8e4350511fdb01a5e9b9c623a40a41
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It's an implementation detail that the default constructed palette
happens to use the d-pointer of the application palette, and as a
result has the same colors as the application palette if requested.
The palette has an empty resolve mask, and hence all the colors in
the palette are undefined. Users should not rely on QPalette() to
represent the application palette when for example overriding a
parent palette.
Task-number: QTBUG-85226
Pick-to: 6.0 5.15
Change-Id: Ia6747887eef6e9a5f21b2002066608c433260de2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The enumeration value was removed in Qt 6 by
1a342b2db1. Ignore it.
Add a check to helper function checkProperty() and move
the code from a5e2f2ddad there
as well.
Pick-to: 6.0
Task-number: QTBUG-89093
Fixes: QTBUG-89700
Change-Id: I0890be8fff155d7342e2386b7f6b0783a5f3a192
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
It's defined in terms of operator<=> on QStringView, which does
not exist, causing a compile error.
Change-Id: I64fc60da4e52c7e53be7849d9b42952be139a816
Fixes: QTBUG-89729
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
CMAKE_ANDROID_NDK is an official variable provided by CMake. The
ANDROID_NDK variable will be set by the NDK toolchain file, but we
don't need to rely on that (the user could theoretically not be using
the NDK's toolchain file). Using the CMake-provided variable means
we don't have to explain the source of the variable in documentation
for the qt6_android_generate_deployment_settings() command. We should
prefer to use things provided by CMake already where it makes sense
and this seems to be one such case.
Task-number: QTBUG-89651
Task-number: QTBUG-88839
Pick-to: 6.0
Change-Id: Ieda54de8f5c65c36da6bb55c87a8b8fdd1d5cd7b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Instead, make them inheritable at creation time.
Change-Id: I1aabc203851b2873acc772ba20258238cbe01d59
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
And renamed PeekRemove* to PeekConsumed to document
better that nodes are not removed when peeking.
Change-Id: I7349f57fcfc3287d1a1309a31ee7f481f8d18755
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When a button has no parent, QAbstractButtonPrivate::queryButtonList()
unconditionally accessed parent which results in a nullptr access. Did
not crash because qt_qFindChildren_helper checks for nullptr and
therefore could only be found with a sanitizer.
Fixes: QTBUG-83865
Change-Id: I591e546e96acba50770935b9c3baaf08b09b833d
Pick-to: 6.0
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
[ChangeLog][QtCore][QProcess] Added support for
setStandardOutputProcess() with startDetached().
Change-Id: I61278cdb7084127f583c8c017688da392017b44c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
[ChangeLog][QtCore][QProcess] Added support for QProcess::MergedChannels
mode with startDetached().
Change-Id: I953ad2063322015332269522a297f8e2842e438c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
We have the same channel forwarding, redirecting, and merging rules for
all platforms. This makes it possible to introduce the openChannels()
function, which consolidates the logic and performs high-level general
processing of the channels configuration properties.
Change-Id: Id3574fc42a56829328369b6a1a6ec9c95fce8eca
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The idea was to create descriptors with HANDLE_FLAG_INHERIT. However,
this can be assumed to be already the case for std descriptors, and if
it isn't, the user messed up, and we shouldn't try to work around it.
This is consistent with what we already do in startDetached().
Change-Id: I8135c5e612c361e77a0442541f2d50cfbb5b4601
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
In theory, low-level functions like CreateNamedPipe() or
DuplicateHandle() could suddenly fail. Thus, in order to ensure the
correct configuration of the channels, we must check for these
errors.
Pick-to: 6.0 5.15
Change-Id: I3d6291043e5e394ec5c5a7d85dfb7b09bfdcd172
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The PostgreSQL driver can change it's connection status
after the first established connection.
In this case, the function "isOpen()" returns false
and the "close()" function would not free all resources.
With this fix, the "close()" function
always frees any allocated resource
independent of the connection status.
Fixes: QTBUG-88984
Pick-to: 6.0 5.15 5.12
Change-Id: I7c9add6a183bf46a8573952ab39f8cb1f728c00c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This method will return a QByteArrayView of the data range corresponding
to the level. This avoids a leaky abstraction by moving the needed data
pointer arithmetic from the caller to the method. It will also make it
easier adding cubemap support in the future.
Change-Id: I2415bd88365d8d69ba14aefc77f5f1117f9e0033
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The configure tests are all in place for CMake as well, and this one
has no special library depdendencies. Generate the CMakeLists and
remove the special case.
Change-Id: I55817045f9e259515fb3aad33d1446d9413111d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Raw string literals (since C++11 according to [1]), make writing/reading
regex patterns easier, since one can just use e.g. "\w\d" without having
to escape those backslashes e.g. "\\w\\d"; this is especially useful with
longer/more complex regex patterns.
[1] https://en.cppreference.com/w/cpp/language/string_literal
Pick-to: 5.15 6.0
Change-Id: I119f9566d27222b915af931ee7e13e064baede61
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Make sure we use the new QXcbScrollingDevice class for the "core
pointer" as well.
Change-Id: I97575e8125cbb2aa280662aa675e61021c21ea59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In 1947, Germany had not only a summer time but also a
"Hochsommerzeit", a high summer time. This patch adds a test
creating a QDateTime in the time gap at the beginning of this
Hochsommerzeit on May 11, 1947.
Pick-to: 6.0
Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Due to a copy'n'paste error in 01ec11507d
the valign was not properly determined for text-align bottom.
Fixes: QTBUG-89366
Change-Id: I081e1b24bba0edd9dd3754599a111c1658b18746
Pick-to: 6.0
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
After improving QtConcurrent::run() to use parameter packs for the
arguments (see c977e74afd), calling
overloaded functions is ambiguous. Updated the porting guide and the
documentation to mention this and describe possible workarounds.
Task-number: QTBUG-89648
Pick-to: 6.0
Change-Id: I4c1f996ae67bce8c13cc1f99f54240295db6ae1d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Use delegate constructors to avoid code duplication
Change-Id: I5c7d3764966ec07d1e3d175ccb075c64408d2338
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change ac210c73e4 introduced the requirement that all input devices with
Scroll capability must have a QXcbScrollingDevicePrivate as their d_ptr.
However, this was not enforced, and would fail for the "Virtual core
pointer".
To fix this, always use qobject_cast to verify that the device is of the
correct type.
Change-Id: I4a6b1d4d79308eb04e9f52dda00294fffe377bdf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QIconModeViewBase::itemsRect() is crashing with Qt6 when an empty
container is passed.
Fixes: QTBUG-89434
Change-Id: I324f1a34b62e67c7bbd3fe33227f4174df7d3d37
Pick-to: 6.0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
QPicture::play() does not save/restore the painting state when called
directly but this was not correctly stated in the documentation.
Therefore add a small note about this.
Fixes: QTBUG-83198
Change-Id: Ia820d32ccb4689d1e696fecffa9d6b5522e246b3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.
Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This feature is not much used on modern macOS, and
Qt 5 has never supported it.
Pick-to: 5.15 6.0
Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
...instead of during createEventDispatcher().
This way, startingUp() will be called [on the thread
being started] also for custom event dispatchers installed
with QThread::setEventDispatcher().
This prevents crashes when installing event dispatches which
expects that startingUp() will be called.
Crash reproducible with test case from QTBUG-51961.
Change-Id: I71bd696539689d928a61ff9b47d05297cf803b2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit f4a66e5c accidentally made it so that the offscreen
plugin would produce a null QPlatformIntegration on
X11 if QT_QPA_OFFSCREEN_NO_GLX is set.
Restore previous logic where the generic QOffscreenIntegration
is created if the X11 code path did not create an object.
Change-Id: Ic71fb04bbd824f4121480dbaf8fa0571ebb39f42
Pick-to: 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
qdoc does not render these nicely when outputting html:
the enum value table table is split in two around the
\note.
Pick-to: 5.15
Change-Id: Ic2b8c5a247d1100a766e4ae10161aa6ee7644514
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
'QT_HOST_PATH' indicates that we use crosscompilation toolchain
to build project. In this case 'Qt6Config.cmake' loads
'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines
correct paths to host tools.
Replace hardcoded paths for host tools by paths recorded
in Qt6HostInfoConfig.cmake.
Correct conditions for QT_HOST_PATH, evaluate it explicitly as
string, but not as boolean expression.
Fixes: QTBUG-86557
Pick-to: 6.0
Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Commands like qt6_finalize_executable() should not rely on versionless
commands or targets being available, since they can be disabled by a
build option.
Pick-to: 6.0
Change-Id: I6a9ab6a9b6a6b731590e5b8c43f73b518ed38e81
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This reverts e52239f525, because we do not
have multi-ABI builds currently, and we must link against what the
WrapOpenSSL package provides.
Fixes: QTBUG-89473
Change-Id: I4f38a2c41e90ec8b602e28f8ca77f0ebd009639c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Alignment problems occur for pushbuttons because they appear smaller then their
actual widget geometry, which is used for their alignment in layouts. To fix,
shift the pushbutton's rect to the left, adjust SE_PushButtonLayoutItem
accordingly and use QFocusFrame to render the focus frame ring outside
the widget's paintable area.
Fixes: QTBUG-89133
Fixes: QTBUG-81452
Pick-to: 5.15 6.0
Change-Id: Iee885a4fb3674d966e5ff3b5c04a0845521b2d72
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
After 6be398 few tests fail/crash with qtcharts.
Fix issue on reallocateAndGraw and avoid accessing
flags on invalid header.
Data::allocate can return invalid header and dataptr,
which takes place if capacity is 0. In code before 6be398
clone method checks if header is not null before resetting
flags. However after b76fbb4 resetting flags is no longer
needed since it is done in allocateGrow.
Task-number: QTBUG-89092
Pick-to: 6.0
Change-Id: I2fde781dad7a0694a5f17ab716f647c2e35f4ff0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
It took me quite a while to figure out that two objects with
a similar type and a similar name which occur side by side have
a quite different meaning. Add a comment for the next one.
Change-Id: Idf4d63d8ed09ead2c3d82a798e6d7476024209bf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
KEYCODE_MEDIA_PLAY_PAUSE was incorrectly translated to Qt.Key_MediaPlay.
This patch changes it to Qt.Key_MediaTogglePlayPause.
Fixes: QTBUG-66448
Pick-to: 5.15 5.12 6.0
Change-Id: Icd2747857bc479228bfdffcd8ab8fdef7b79e918
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
By using new QSocketNotifier API, we can avoid unnecessarily enabling
the notifier right before turning it off again.
Change-Id: Ie0dea00251e9885653677c495dfc5abaaa4db1c7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This patch amends a41701904e
If peeking into the event queue looking for a clipboard event fails,
QXcbClipboard::waitForClipboardEvent() calls queue->peek for the second
time to "process other clipboard events, since someone is probably
requesting data from us". QXcbEventQueue::peek() in turn calls
QXcbEventQueue::flushBufferedEvents(). This second flushing can acquire
a waited-for clipboard event. The issue was that the code in
waitForNewEvents() ignored this possibility and assumed that there were
no clipboard events before or at its current m_flushedTail. If there
were no more events on the X11 connection after tailBeforeFlush,
the waitForNewEvents() in waitForClipboardEvent() blocked execution
for 5 seconds and eventually timed out.
The fix is to remember QXcbEventQueue::m_flushedTail just after looking
for and not finding a clipboard event in the queue. And then wait for
more events via QWaitCondition in waitForNewEvents() only if there were
no more events after the remembered m_flushedTail.
Fixes: QTBUG-75319
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I4919c5b9b9227b3a8a29a11e7094f97960b3a121
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This would steal an existing binding from a property, which is most
likely not the intended action.
Alternatively, we could make it equivalent to
Qt::makePropertyBinding(foo), but that conflates properties with
bindings to it. On the other hand, this would avoid a potentially
source-breaking change.
[ChangeLog][Potentially Source Breaking Change] It was possible to
create a QPropertyBinding from a property; this would steal any set
binding from the property or create an invalid binding if none was set.
Use makePropertyBinding if you want to to create a binding which depends
on the property's value, or takeBinding if you want to repurpose the
property's binding.
Fixes: QTBUG-89507
Pick-to: 6.0
Change-Id: Icd2d3b9261b60f36948f2cea9c33ddbea36efbc1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This adds functionality for marking properties (QProperty and related
classes) manually as dirty. This facilliates the integration of bindable
properties with non-binable properties and makes it possible for
bindable properties to change due to external events.
Fixes: QTBUG-89167
Change-Id: I256cf154d914149dacb6cadaba92b13c88c9d027
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
When accessibility was not active it was possible to force its
update, causing a null pointer exception in java.
Pick-to: 6.0 5.15
Change-Id: I60f65612d6e9f712ba3c591ffcc6803f06f09efb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Remove a second argument to the setSocket(qintptr, bool) function as
it makes the API harder to understand.
Change-Id: Ib1852a4e9d96adde35bfbf0fe03b386d9ded395a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
We only need to check QGuiApplication::quitOnLastWindowClosed() at
the point where we've actually concluded that the last window was
closed.
Checking for !q->parent() was redundant, as we were already
exiting early when !q->isTopLevel().
Pick-to: 6.0 5.15
Change-Id: I934e186d707361b31d19692c04d2e17b7ba0f49e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The child process inherits a standard handle of the main process in
such cases:
stdin - inputChannelMode == QProcess::ForwardedInputChannel,
stdout - processChannelMode == QProcess::ForwardedChannels ||
processChannelMode == QProcess::ForwardedOutputChannel,
stderr - processChannelMode == QProcess::ForwardedChannels ||
processChannelMode == QProcess::ForwardedErrorChannel ||
processChannelMode == QProcess::MergedChannels
For these combinations we should not create pipes and notifiers as
they would not be used.
Change-Id: I8e3836e4d840a40b338c85c54645539ebcaab3f6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
For some reason, clang (and thus Qt Creator's code model) did still warn
about the offsetof usage. Moving the warning pragmas one layer higher
appears to fix the issue.
Change-Id: I1ee1cfd690fdcce9105c65e508203a722fe63151
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The pro2cmake script doesn't handle static scopes correctly, and the
generated "CONDITION static" must read "CONDITION NOT
QT_BUILD_SHARED_LIBS".
Change-Id: Ic5a5763e9fd5f5d04fb4c12227cbe85fac17b826
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
It can happen that updateApplicationState() is called before
m_androidPlatformIntegration is set. In such case, new applicationState
will be remembered and propagated later.
Before this change, pending application state was passed only to
QWindowSystemInterface.
ResumePauseListeners that are subscribed for changes to
ApplicationActive/ApplicationInactive state also should be informed
about new application state.
Fixes: QTBUG-84737
Pick-to: 6.0 5.15
Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Another case when an OpenSSL's call can dump some errors into the shared
error queue discovered. An invalid certificate with non-null X509 * may
result in several errors appended to the queue.
Pick-to: 6.0 5.15
Change-Id: I1278b371bd1edf2d656760c371bfb6da5dcab6ec
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Skip the memcpy when src is null.
Also silences a Codechecker warning.
Pick-to: 6.0
Change-Id: I5042d725000cb6dff6864408fa9ed9e0ca35145a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Something defined is always greater than undefined
Pick-to: 6.0
Fixes: QTBUG-89530
Change-Id: I7633dd4233f7b13c3c5be17352841ec873531ef9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
After f08492c6fd was
merged this bug would manifest as an entry appearing twice
in the chain when a updating an existing entry (insert with
an existing key). This could sometimes result in crashes later
as the list filled up and the list was used in trim() to remove
various entries.
Fixes: QTBUG-89176
Pick-to: 6.0
Change-Id: Ide80160fb4317dc0aefe79eec5dce7ec6813e790
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Until now, all wheel events came from one "core pointer". It's useful
in Qt Quick to tell the devices apart, because some support smooth scrolling
and some don't.
Also remove the QHash storing legacy ScrollingDevice structs, and use
a subclass of QPointingDevicePrivate instead.
Task-number: QTBUG-46412
Task-number: QTBUG-72167
Task-number: QTBUG-69433
Change-Id: Ie6a3d8dd494f981e8706b9a66a1021dfb51baec4
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The QString documentation is aligned with QList regarding common
wording and ideas:
- Extend general class description
- Revise description of several methods
- Fix examples to use qsizetype instead of int
- Wrap descriptions at 80 characters
Pick-to: 6.0
Task-number: QTBUG-87962
Change-Id: I7d5a7e829ce8b98a0a1a7fae6b7ae0dec4effbae
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
When using MSVC compiler and -DFEATURE_static_runtime=ON, qrc_foo.cpp
and qtentrypoint_win.cpp are still compiled with '-MD' or '-MDd' flag,
which will cause following warnings and other possible problems:
warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs;
use /NODEFAULTLIB:library
Pick-to: 6.0
Change-Id: I6794930a64e9cff4dc1c9632fc3fc64227848af0
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove heading that causes QDoc's autolinker to link incorrectly.
* Clean up language a bit while at it.
* Drop a double space.
Fixes: QTBUG-89283
Pick-to: 6.0
Change-Id: Ice778d66deab384b66eb50b790670c9e3c8b0e84
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
The case no conversion was needed wasn't handled, but was assumed to be
handled by some call sites.
This can speed up QPixmaps on devices with non-standard screen formats.
[ChangeLog][QPixmap] Opaque pixmaps on devices with a non-standard
opaque format will now correctly match format for faster blitting.
Same with semitransparent pixmaps on devices with a non-standard
semitransparent format.
Pick-to: 6.0 5.15
Change-Id: Ia05ff518fea36b7e3ed5c089fa9e8681a02fc574
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Historic QDateTime behavior when being asked to create a
QDateTime in the DST gap was to interpret the given date
as if it was in the time before that gap, mapping it to a point
in time after the gap. This has changed with
a04411119e .
Since then, the given date is interpreted as if it was in the
time after the gap, thus being mapped to a point in time
before the gap.
This patch restores the historic behavior.
This was not caught by Coin because machines ran in timezone
"Atlantic/Reykjavik" which does not have DST since 1967.
This patch changes tests to always run in "Europe/Oslo".
Driveby: Test function "findSpring" did some operations in
local time, even though being asked to work in a specific
time zone. Fixed that.
Fixes: QTBUG-86960
Fixes: QTBUG-89208
Pick-to: 6.0 5.15
Change-Id: Iecce5898bf9711a10e7dfc0a25e4bbeaed1c8ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The \Q_OBJECT macro has been removed but using Q_OBJECT in the file
would erroneously trigger automoc. Avoid the issue by moving
the snippet into its own file.
Task-number: QTBUG-89505
Pick-to: 6.0
Change-Id: I6630ff4bfcbf33eae348ac3d92aae1878dc573ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
QXcbVirtualDesktop::m_workArea is not updated after screen rotation
if _NET_WORKAREA is not updated, e.g. when a window manager is not
running.
Use width of -1 for m_workArea to indicate that _NET_WORKAREA is
not set and thus there is no need to find its intersection with
screens' geometries.
Pick-to: 5.15 6.0
Change-Id: Ic1f3ec23576ed8407a76cc2b9f84a145c67b1d4b
Reviewed-by: Liang Qi <liang.qi@qt.io>
Technically, having a single constructor limits the use-cases for this
class. We should take into account that:
- an opened socket descriptor must be available at the moment of
construction;
- the constructor unconditionally enables the notifier (the possible
solution
notifier = new QSocketNotifier(...);
notifier->setEnabled(false);
is suboptimal due to heavy operations inside the event dispatcher);
- for these reasons, QSocketNotifier most often cannot be a member of
another class (we have an extra allocation and indirect access).
This patch addresses this shortcoming by making it possible to set the
socket descriptor at a later point:
[ChangeLog][QtCore][QSocketNotifier] Added setSocket() and an additional
constructor which requires no socket.
Change-Id: I2eb2edf33ddafe99e528aac7d3774ade40795e7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
These methods should never be used on strings not known to be valid UTF-16.
Their optimizations will produce undefined behavior otherwise.
Change-Id: I03a95140dcbdd1f7189eea1be69289ce227331a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Lexicographical is not the right word for the comparison description.
Other classes use the term "lexical", so QList is updated
in that way too.
The link to cppreference is left, because QList actually uses
std::lexicographical_compare, so it's completely valid here.
Pick-to: 6.0
Task-number: QTBUG-87962
Change-Id: I37bd3a92c5a3f857266e9c483d14e64eb90ce2c7
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The QStyleOptionButton::CommandLinkButton feature is already set in the
QComnandLinkButton's initStyleOption() so remove its setting in the
paintEvent.
Change-Id: Ic1d723c0671d6d478825d7ba2173db72a8b39c36
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We should return the result of the call of the base implementation for
all events that we did not handle. Also, QObject::event() does not
actually activate any filters, so the comment was inaccurate as well.
Change-Id: Iff6644b7b1621229f8351c83569ee72594e47197
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Since QPushButton sets WA_MacShowFocusRect attribute upon init, this
will be set for QCommandLinkButton too. However, we do not want to draw
the Mac focus frame for QCommandLink buttons so remove this attribute
for them.
Pick-to: 5.15 6.0
Change-Id: Ida7a437a54be078caaebc2c0744243d50e14a87f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In QPushButton::initStyleOption() there is no style option feature set
to distinguish QCommandLinkButtons. The QStyleOptionButton::CommandLink
Button feature is only set during the paintEvent, but in some cases we
need to check for this feature before painting.
To fix, override initStyleOption for QCommandLinkButton and set the fea
ture there.
Pick-to: 5.15 6.0
Change-Id: I8831a6be7da642dcf8830812d99681213e7515dc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Added overloads of .then()/.onFailed()/.onCanceled() which take a
pointer of a context object, and invoke the continuations in the
object's thread.
Task-number: QTBUG-86794
Change-Id: I0f3cbb0500695673fc4087af5d4b96b416e3e1ce
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
It wasn't strictly necessary, and was causing a warning due to
the use of a character literal.
Change-Id: I3552ab06189b3a3f1a635b75bd6c4d8a5bce03f8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QTableViewPrivate::heightHintForIndex()/widthHintForIndex() did not
honor spans and therefore returned too big values.
Fixes: QTBUG-89116
Change-Id: I52948902b7eaaa27c092ed39da68950c3840e8e4
Pick-to: 5.15
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Amends 4d94384612:
- The macOS style must now elide the text by it's own since it is
no longer done by QHeaderView
- Add documentation of QStyleOptionHeader::textElideMode
- Remove unused variables from QHeaderView::initStyleOptionForIndex()
Task-number: QTBUG-86426
Change-Id: I98fc6771c0cd56d6002390125ffbab1269f6dd39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Previously neglected, in dateFromParts() and dayOfWeek(), which only
make sense for valid dates.
Pick-to: 6.0 5.15
Change-Id: I44879bb441dbf51b96c8fd4d45e8f07423e63047
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise it will prevent quitting of the application when the last
window is closed, on account of (seemingly) being a top level window.
Pick-to: 5.15 6.0
Change-Id: Ib79615dd1e9394c96d39c8f9851005b4c073c165
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Some parts of qt6_add_executable() need to take into account certain
target properties, but the target is created within the function.
The caller doesn't get the opportunity to modify those properties
before they are used. This change provides a way to defer those
property-using steps until either the project explicitly calls a
function to finalize the target or the end of the current directory
scope is reached.
Automatic deferral to end of scope is only supported for CMake 3.19+.
With CMake 3.18 or earlier, deferring the finalization step has to be
explicitly requested with the new MANUAL_FINALIZATION keyword. The
caller is then responsible for also calling qt6_finalize_executable()
later. When the keyword is given, automatic finalization is disabled
even when using CMake 3.19+.
Note that while this could be implemented without CMake 3.19 features,
other work relating to qt6_import_qml_plugins() will require it so we
may as well use this method now.
Fixes: QTBUG-88840
Task-number: QTBUG-86669
Pick-to: 6.0
Change-Id: Ic3854672ba18cff5af2ffd7f63596aa3ac492f33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is the most basic way to represent custom transfer functions.
Change-Id: I529fb647ece82c03e85ef77b056d9daf13fe5a61
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
gcc 9.x (but not 10.x) issues a bogus warning when strlen is used on a
string literal; disable the warning for those versions.
Upstream bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91490
Change-Id: I7a2a4d0f6ddafcafcd9fcc62fc41ad5d78e61627
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Otherwise, it would report that lastIndexOf of an empty pattern
in an empty string doesn't exist. Next commit adds extensive autotests;
for now, disable a broken autotest (which already features a comment
about why it's broken).
Change-Id: I9a0e5c0142007f81f5cf93e356c8bd82f00066f7
Pick-to: 5.15 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We must call qt_set_common_target_properties on Bootstrap too, because
that's were FEATURE_static_runtime is handled.
Change-Id: Ie54f7d599d0c3a54b761e6c679983b475e77c17d
Pick-to: 6.0
Fixes: QTBUG-89201
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
There's an assertion. Found by Google fuzz scan of CBOR data.
Pick-to: 6.0 5.15
Change-Id: I55083c2909f64a1f8868fffd164f1ff3af71605b
Reviewed-by: David Faure <david.faure@kdab.com>
Simplifies the code a little bit
Pick-to: 5.15 6.0
Change-Id: I7b9b97ae9b32412abdc6fffd164545632be4590a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This reverts commit c730a29260.
Reason for revert: The original change was wrong and caused
androiddeployqt to skip valid QML resource paths.
Additionally, change log output from "file" to "path" when skipping
an import path.
Pick-to: 6.0 5.15
Fixes: QTBUG-89281
Change-Id: Ic338d147a04a03bb1d7acbede11b647ff036922a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Unlike the previous code, we now entrust the compiler to properly
implement thread-safe statics for this code. That was the main reason
why the old code was confusing, trying to determine if the clock IDs
were positive or negative.
Instead, simply make a call to clock_getres(CLOCK_MONOTONIC) and that
will tell us if the monotonic clock is supported.
Change-Id: I0031aa609e714ae983c3fffd1469522a68fa3b66
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There is an off by one in the implementation of count(): a match
must be attempted even at the very end of the string, because
a 0-length match can happen there. While at it, improve
the documentation on the counter-intuitive behavior of count(),
which doesn't merely count how many times a regexp matches
into a string using ordinary global matching.
[ChangeLog][QtCore][QString] Fixed a corner case when using
QString::count(QRegularExpression), causing an empty in the
last position not to be accounted for in the returned result.
Change-Id: I064497839a96979abfbac2d0a96546ce160bbc46
Pick-to: 5.15 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
NSTitleBarView in Big Sur will observe the window it is in, but makes
sure to remove these observers in viewWillMoveToWindow, as it should.
To avoid spamming user logs with this warning we remove it.
It was dubious what cases it would have caught anyways, as anyone
trying to KVO observe properties Z of a child object Y of X.Y would
need to track whether X changes its Y between adding and removing
the observer. There are no guarantees that Y is stable, and this
applies to an NSView's window property as well.
Pick-to: 6.0
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I27a0d04625f96c4c5d382c39ac068721ce1e8f9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QWidget::isTopLevel() is deprecated and can be replaced 1:1 with
isWindow(). Sadly it's was not marked with Q_DECL_DEPRECATED in 5.15
Change-Id: I4508fbde41927f3b82e47a75011179548325029d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
All APIs are static, so there is no "this" pointer.
Pick-to: 6.0
Task-number: QTBUG-89082
Change-Id: I4bfe6c14304d311b903878acd5b4c8169f4065c7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
It makes no sense to poll the I/O pipes if we didn't get a start-up
notification yet. And in fact, all waitFor...() functions except
waitForReadyRead() did already explicitly wait for process startup
completion. So fix that one up, and remove the handling of 'Starting'
state from the I/O loops.
Change-Id: Ibb7eb7c768bef3f9b6c54009c73b91775570102c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
When an eager binding triggers a setBinding call, we end up with a
special kind of binding loop:
setBinding() -> evaluate -> notifyObserver
^ |
| /
----------------------------
We now catch set condition, and set the binding status to BindingLoop
(with a distinct description).
Task-number: QTBUG-87153
Task-number: QTBUG-87733
Pick-to: 6.0
Change-Id: I9f9915797d82eab820fc279baceaf89d7e5a3f4a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Replacing QElapsedTimer with QDeadlineTimer simplifies the code in
waiting functions, which also improves readability.
Change-Id: I56aedd356b547b6735ed0985dc81be706e292437
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Due to how regex matching works, lastIndexOf has to be implemented
by matching from the string's beginning until the from position
is reached. This might not be obvious for users, so document that.
Task-number: QTBUG-89050
Pick-to: 5.15 6.0
Change-Id: I4b69ea753e7d417d980031926f1e01d77e58720d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use high-quality scaling to improve rendering in cases
where the pixmap has to be scaled down, such as when
drawing a @2x pixmap at 150%.
Change-Id: I216b03b61dfa2cc2cc8c573e24a576424f6f5d17
Fixes: QTBUG-88982
Pick-to: 6.0 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
KeyValueObserver and RunLoopModeTracker were causing
“Class is implemented in both...” messages when loading
multiple namespaced Qt versions into the same process.
Change-Id: Idbd2229c61cde6fba2c12b35d045390a371dee68
Fixes: QTBUG-89059
Pick-to: 6.0 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Update some wording to align with QString
and QByteArray documentation
Pick-to: 6.0
Task-number: QTBUG-87962
Change-Id: I8162769c1a5fc94fc8920ad0d4d91e95fe74825f
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Accidentally changed to pass-by-value while doing that to QDate,
in commit af837734b2
Task-number: QTBUG-86400
Change-Id: I8d2db532f537e5f82a5f3b36e72fcf7fefdd2ee5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 8db0d701e8b1fe00cdd5d71c18afff84de606013)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some links were broken. Some stated to be pointing to OpenGL ES 2.0
documentation but pointed to OpenGL ES 3.2 documentation.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Iad25d8f709b8fa9421039d5cb51cee21093e3191
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Fix warnings
qstring.cpp(9650): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data
qstring.cpp(9654): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data
QDataStream::writeBytes expects an uint as second parameter, not size_t.
This reverts parts of 744e55b85a, where the explicit cast to size_t
was introduced.
Pick-to: 6.0
Change-Id: I2750a6f48fc09730aa9fa21dcc31f82e33b48b8b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The documentation is only a stub, and hasn't been built since Qt 4 times.
qlalr is also first and foremost an internal tool nowadays, so it's very
unlikely we will fully document it.
Change-Id: I68821bf1f9ca3811ec8adda583f0c7326421c6b6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The font role in the header view was not taken into account when the
text for an item should be elided. This leads to a wrongly elided text
esp. visible when the font size is different to the font of QHeaderView.
Fix it by passing the elide mode to the style since only the style knows
the used font (e.g. bold or not bold) and available rect. This is now in
sync with CE_ItemViewItem where the eliding is also done by the style
and not by the item view.
[ChangeLog][QtWidgets][QHeaderView] QStyleOptionHeader got a new member
textElideMode.
Fixes: QTBUG-86426
Change-Id: If6914fe5aaa5d285e6da55d2129f9249d90da3d7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Calling QCoreApplication::tr() without #if QT_CONFIG(translation)
can cause the build to fail if configured without translation.
Changing the call to QCoreApplication::translate() fixes that.
Pick-to: 5.15 6.0
Change-Id: I48f0e1be14fc81360b8268620afc2f6c8f255819
Reviewed-by: Andy Shaw <andy.shaw@qt.io>