Use QThreadPool to process QImage smooth-scaling, format conversions,
and colorspace transforms multithreaded.
Change-Id: Ic142b1fa899f56e7e5099d36ca713701a47b681b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Even if there are no printers installed, we can still show the print
dialog, which gives the user feedback about no printers being installed,
allows them to install one, or allows them to print to PDF as a
fallback.
The code for printing to PDF has been re-enabled, and the conditions
of QTBUG-38820 have been removed as the problem is no longer present.
The code also takes into account the possibility that the user chose
to print to PostScript, which we don't yet support, but warn about.
We now also support opening the printed document in Preview. This
requires a minor assumption about the print operation being done
synchronously after the print dialog is accepted, but this is
something we can improve in the future with internal APIs if it
turns out to be a problem.
Printing workflows such as sending the printed document via mail
or messenger are not not supported, and will give a warning.
Fixes: QTBUG-36112
Change-Id: I8ba9e2c5ce31a5a06542c4a7126d005e4b27f2be
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Add documentation on how to use a module from CMake, alongside
the existing documentation about qmake.
While at it, also remove the mentioning of the central include;
It is not something we should actively advocate anymore. Instead,
the documentation of every class gives the correct include to use.
Task-number: QTBUG-73058
Change-Id: I71ed5a62f4f0a6d868dd1f84ea39e5ac385a2fb8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
To bring it in line with the other platforms, then it needs to check if
the initially selected files are set and use the first one. Otherwise it
can fall back to the initial directory if that happens to include a
filename.
Change-Id: If34ae0e7e10b6a3c25e9422d9b4f2c21e6bfc8d1
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The ODBC driver did not properly decode table names with unicode chars.
Fix it by explicitly passing the unicode flag to qGetStringData().
Fixes: QTBUG-82401
Change-Id: Id6eb44cc85ce196ea97d0d6aef1cd573fa033970
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This is deemed more appropriate than having some time consuming tracking
of descriptor types in pools, just to avoid the rare case of attempting
a failing vkAllocateDescriptorSets(), which is then always followed by
another, successful attempt.
Change-Id: I7a3a1d80afe400dc96605a3d6c834e8b2c71143a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
macOS 10.12 introduced automatic window tabbing, where the OS provides
tab handling on behalf of the application. The feature defaulted to
being on, and the release notes asked applications that had their own
tab handling to disable the automatic tab handling explicitly.
Qt has its own tab handling, and should therefore disable the automatic
handling. We do this on a per NSWindow basis, using the tabbingMode
property of the window, instead of the global allowsAutomaticWindowTabbing
property on NSWindow, so that individual windows can still opt in to
the automatic tab handling. Doing it via the tabbingMode property
also ensures that we're not affecting the host application's
behavior in a plug-in setting.
Ideally Qt's tab handling should read the userTabbingPreference
property of NSWindow to pick up the system preference choice of
whether to open new windows as standalone windows or tabs, but
this is left for a later change. An alternative would also be to
use the automatic window tabbing instead of our own implementation.
Fixes: QTBUG-61707
Change-Id: Icf2078b63ec16202ff7fd83ea264a48dc61978e1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The commits e1e08629 and 66e905b1 introduced undefined behavior. Fix
this by assigning the result of takeFirst to a temporary.
Change-Id: I9e29412cf632d4836b95d47e12d8c07ab0645fbb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
No point in linking to itself.
Change-Id: Id0bf3fa6878417e541ec0997d34758b0c59e99b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Introduces a new QRhiShaderResourceBinding function that takes an array
of texture-sampler pairs. The existing function is also available and is
equivalent to calling the array-based version with array size 1.
It is important to note that for Metal one needs MSL 2.0 for array of
textures, so qsb needs --msl 20 instead of --msl 12 for such shaders.
Comes with an autotest, and also updates all .qsb files for said test
with the latest shadertools.
Task-number: QTBUG-82624
Change-Id: Ibc1973aae826836f16d842c41d6c8403fd7ff876
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Do not use the deprecated method QProcess::start(QString) anymore.
Change-Id: I09eae2c8a1dbb53fd2de004e5030da9bb3c07b14
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Implement this method in terms of splitCommand and
QProcess::execute(QString, QStringList).
Change-Id: I1fe78fb53d8b6b34a8796f9fbda380a98a840c99
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
- QLoggingRule::parse() and the ctor take pattern as QStringView
- parseNextLine takes lines as QStringView and produces the pattern as
QStringView for QLoggingRule
- (setContent has to wait for QStringTokenizer)
- QLoggingRule::pass()'s first argument is always QLatin1String, so
take it as one
Use chopped() more, add a std::move().
Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In QByteArray, they were just not marked as such.
In QString and QStringRef, the implicit conversion from QChar to
QString would destroy it. Add a QChar overload, delegating to
QStringView.
Added docs for the new overloads, copying from the nearest neighbor so
as to not look out of place. All string classes use different wording
for these functions. A cleanup of this state of affairs is out of the
scope of this patch.
Change-Id: I0b7b1d037aa229bcaf29b793841a18caf977d66b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This change adds support to UiaRaiseNotificationEvent() in the
UI Automation-based accessibility code, and uses it to notify changes
in string-typed values, allowing Narrator, NVDA and other screen readers
to notice changes in the application state that were previously missed.
Fixes: QTBUG-75003
Change-Id: I646ca3a851ab7b69817d900b002eb91a3bf607a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Silence compile time warning and show correct usage in example
snippet.
Change-Id: I1936f006e4b5f3ca71bbc0100ed039beeb459271
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
We adopt the context of the print session, so the code is not needed,
and would just produce a warning since QMacCGContext didn't know what
to do about the printer paint device.
Change-Id: I9ac079f5cb5d98022045632592d0e375710eecc3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
NSSavePanel does not deal well with multi-part extensions, to the point
where it will fail to open if that's the only acceptable extension.
We follow Chromium's lead here and reduce the extension to its last
component, which enables selecting and saving files such as 'foo.tar.gz'.
To improve the user experience we always show file extensions when we
detect a multi-part extension. This makes it clearer what the final
extension will be, and avoids confusing macOS about the intention of
the user when choosing a file that without the final extension also
matches another known extension.
Fixes: QTBUG-38303
Fixes: QTBUG-44227
Change-Id: Id0cee84f758c2cd59fcf1b339caa30f7da07dd1e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The compiler must emit the destructor for the members of a class in an
inline constructor, in case the constructor throws. This won't work in
Qt 5.15 due to QList requiring knowing whether QMimeMagicRuleMatcher is
trivial or not. Another solution would be to use QVector.
Fixes: QTBUG-82547
Change-Id: Ia8b65350cd5d49debca9fffd15f79db872ed7c0c
Reviewed-by: David Faure <david.faure@kdab.com>
This patch adds the arrow operator to the stl-like key-value
iterator (QKeyValueIterator) for QMap and QHash.
This allows using normal member access syntax it->first and it->second
instead of having to use (*it).first and (*it).second.
[ChangeLog][QtCore][Containers] Added operator-> to the key-value
iterator for QHash/QMap.
Change-Id: I9cfa6480784ebce147fcfbf37fec5ad0080e2899
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
QMenu hides regularly when the user interacts with it, and manages
the firing of signals based on that. It ignores if a QAction that is
added to it fires the triggered() signal programmatically.
With QWidgetActions added to the menu, the menu usually doesn't get
interacted with directly, as the widget gets the input events.
Since the action can be added to multiple menus, neither widget nor
action can interact with the menus programmatically. Instead, the
menu needs to hide when the widget action triggers.
Test included that covers the case where a QWidgetAction is added
to multiple menus that are visible. Documentation updated, and
removed a redudant paragraph as a drive-by change.
[ChangeLog][QtWidgets][QMenu] a popup menu hides when a QWidgetAction
added to it fires the triggered signal.
Change-Id: I69f378426a45c2e46cebdaa5e6f1b21c8fb03633
Fixes: QTBUG-10427
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When QEventDispatcherWin32::closingDown() is called,
threadData->eventDispatcher is already nullptr and the application
will no longer process the events.
Thus, just as it works for socket notifiers and timers, it makes sense
to disable all active event notifiers at this point. Otherwise, it
seems possible that an object in signalled state can provoke a data
race in the notifier's callback on 'edp' pointer, if
QWin32EventDispatcher destructor is running simultaneously.
Task-number: QTBUG-64152
Task-number: QTBUG-70214
Change-Id: I6e77f3eeca1b0ea639021e73b86798cba0200ebf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is a follow-up to commit 895939c7f9
to fix deprecation warnings it added.
Change-Id: I3d86655ec2c84c1bdcac9c70436075fc78f2f781
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is inconsistent with the other similar functions in QVulkanWindow,
we do not provide getters for those either.
Change-Id: If764b49f4b26ff14a2fa908b8d5b37429047250c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Relevant when doing custom rendering combined with QRhi, and only for
APIs like Vulkan, where image layouts are a thing.
As shown by demo apps, it is not currently possible to implement a
correct application that renders or raytraces into a QRhiTexture's backing
VkImage, and then uses that QRhiTexture in a QRhi-based render pass.
This is because QRhi has no knowledge of the image layout if it changes
due to commands recorded by direct Vulkan calls, and not via QRhi
itself. So, except for certain simple cases, one will end up with
incorrect image layout transitions in the barriers. (at minimum this
will be caught by the validation layer)
To remedy this, add a simple function taking the layout as int (we already
do the opposite in nativeTexture()).
Task-number: QTBUG-82435
Change-Id: Ic9e9c1b820b018f3b236742f99fe99fa6de63d36
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This is the first time that we add something to QShaderDescription
after migrating to the non-JSON based serialization system. This now
involves checking the "qsb version" when deserializing.
Task-number: QTBUG-82624
Change-Id: I2bd875ef21e461559b878dccc5537cdfa43feaa2
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
We use the this struct to describe combined image samplers and storage
images as well. Especially with the former, it is not unlikely that we
will need arrays, so e.g. layout(binding = 1) uniform samplerCube
shadowCubes[8]. In this case the '8' is something that must be reported in
to the reflection information.
The new arrayDims member is expected to work exactly like the similarly
named member in BlockVariable.
Task-number: QTBUG-82624
Change-Id: I1fb8b0318906ff4c116c1a7ec23a399c6545c730
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Instead of
qputenv("QT_VULKAN_DEVICE_EXTENSIONS", "VK_KHR_get_memory_requirements2;VK_NV_ray_tracing");
one can now do
params.deviceExtensions = { "VK_KHR_get_memory_requirements2", "VK_NV_ray_tracing" };
on the QRhiVulkanInitParams passed to QRhi::create().
The environment variable stays important for Qt Quick applications, which provide no
configurability for the QRhi construction (yet). On the other hand, applications using
QRhi directly can now also use the new approach to specify the list of device extensions
to enable.
In addition, take QVulkanInfoVector<QVulkanExtension> into use. There is no reason not to
rely on the infrastructure provided by QVulkanInstance. This also implies showing an
informative warning for unsupported extensions, instead of merely failing the device
creation. (applications will likely not be able to recover of course, but at least the
reason for failing is made obvious this way)
Task-number: QTBUG-82435
Change-Id: Ib47fd1a10c02be5ceef2c973e61e896c34f92fa3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Newer versions of QShaderBaker will now use distinct, zero-based b, t+s,
and u register spaces in the generated HLSL source. If this is the case,
the native resource binding map (which so far we only used with Metal)
contains the SPIR-V binding -> HLSL register binding mappings.
This way we won't end up with invalid resource binding attempts (consider
that e.g. D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT is only 16), just
because, for example, a combined image sampler had a binding of 18
which then got blindly mapped to s18 and t18 in HLSL.
Task-number: QTBUG-82472
Change-Id: I8bdcb5378634cf159f6367424582f9e9e5821c8e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Otherwise it is impossible to write an application that pulls out the
VkBuffer for a Dynamic QRhiBuffer, and then uses it with custom Vulkan
operations that read from the buffer. More precisely, the problem arises
only if the buffer in question is not used in combination with any QRhi
operations, because in that case there is nothing that would trigger
doing the host writes queued up by a resource batch's updateDynamicBuffer().
Task-number: QTBUG-82435
Change-Id: Ieb54422f1493921bc6d4d029be56130cd3a1362a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Querying the VkSurfaceKHR for a window is expected to create the surface once
and then return the same value afterwards.
Task-number: QTBUG-82600
Change-Id: Ib3e99dfca4d940de1a14348eb1909d372a7dde04
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Surface creation may be triggered on a thread other than the main thread.
To enable this, MoltenVK also accepts the CAMetalLayer instead of the NSView.
See https://github.com/KhronosGroup/MoltenVK/pull/258
Task-number: QTBUG-82600
Change-Id: I7b925210d05235baf04441682760f09fe58d8144
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
For compatibility with std::unordered_map. Spotted in the API review.
Change-Id: Ic34600d55baebcbbf115c1090cd555984037c44c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Always keep the out of bounds check for backwards compatibility,
but warn about it, so that we can remove it in Qt 6.
Amends commit ebf695bc77
Change-Id: I3f1e7e8f9f20feb0b0f06ff9083c26682f1c7d3b
Reviewed-by: Richard Öhlinger <richard.oehlinger@adbsafegate.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We will remove the virtual base class function in Qt 6.
For now, name() returns format().
Change-Id: I1597e823b859e4db148b3e5ac0f1c15350a582eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>