Fix warnings about float constants and comparison.
Use member or constructor initialization.
Introduce some const for clarity.
Use Qt_CONFIG.
Task-number: QTBUG-81254
Change-Id: I71a6ebfba397c0f8e1dd2e61167233c8e5c137af
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
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>
QSFPM::reset() is deprecated and begin/endResetModel() should be used.
Therefore adjust the documentation to reflect this.
Fixes: QTBUG-82470
Change-Id: I786b3f25e5674d97d0ef6a0c91342973d5e952e9
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@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>
The std::is_pod trait is deprecated in C++20; is_trivial
and is_standard_layout exist since C++11.
Change-Id: I4b901d8edf1a55001764445aee9c338d3dc23b21
Reviewed-by: Lars Knoll <lars.knoll@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>
Amends 2f366a63b2.
Task-number: QTBUG-82682
Task-number: QTBUG-81342
Change-Id: I30f465bf432e27828db460f6dbbb59eee0cca8f2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@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>
QLinkedList has been deprecated, but we still need to test it. Suppress
the warnings for QLinkedList used in tests. Note, that I had to move
some of the test code, to avoid repeating
QT_WARNING_PUSH/QT_WARNING_POP everywhere.
Change-Id: I4203b3ef50045c4f45475a08638dbdc60f68761d
Reviewed-by: Lars Knoll <lars.knoll@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>
For qgraphicsitem_cast to work correctly with custom items, one must
reimplement the type() function for each custom QGraphicsItem subclass.
Do that in the example code.
Fixes: QTBUG-7357
Change-Id: Ibf221817908355f0347cddfc46747b6955958f5f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
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>
printsupport features are only available if the module is available for
the configuration. Every printer feature check has to be coupled with a
check for the module itself.
Change-Id: Id2ca84e71d5d74463d0ff35e8b18b252a779a883
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
No surprises, as char16_t is transparently handled by QChar overloads.
Ok, one surprise: we seem to have QChar <> QByteArray relational
operators, but they don't work for char16_t. Probably members of
QChar, so LHS implicit conversions are disabled. Didn't investigate,
because it needs to be fixed at some point anyway, but that point is
not now.
Change-Id: I74e1c9bdd168e6480e18d7d86c1f13412e718a32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
... to not fold QChar tests into QString ones.
This is needed for adding char16_t tests.
Change-Id: I2507d7d68a39ff96cf033eadde10e383dc976dda
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 was taken from abc473fb8fb99900 in SQLite, ref:
https://www.sqlite.org/cgi/src/info/abc473fb8fb99900
Fixes: QTBUG-82533
Change-Id: I9840e29f19a0b861229987f5b59d8585ba2e55dc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Ammends 4ac872639e. Change return type for getPrefix to eliminate
toLatin1/fromLocal8bit conversion of initial value for relocatable
prefix to preserve not-latin1 characters and return valid prefix path.
Fixes: QTBUG-81462
Change-Id: I15cfa49e9e440e257b04dd31803cd1478f3b07f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
The test was fixed and metrics show no flaky failures anymore.
Task-number: QTBUG-58713
Change-Id: I50c0844db099f45bb5b7ca51a510bf0318554c44
Reviewed-by: Lars Knoll <lars.knoll@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>
And make pHnd atomic.
The majority of the variables is updated in QLibraryPrivate::load_sys
and updatePluginState(), which get the mutex protection.
QLibraryPrivate::unload_sys() doesn't need a mutex protection because we
have the refcounting.
[ChangeLog][QtCore][QLibrary & QPluginLoader] Fixed a number of race
conditions caused by having two QLibrary objects pointing to the same
library being operated in different threads.
Fixes: QTBUG-39642
Change-Id: I46bf1f65e8db46afbde5fffd15e1a5b3f5e74ea4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
resolve() is technically thread-safe if the library has been loadaed. We
don't promise that, but it's there. More importantly, because
QLibraryPrivate is shared among QPluginLoader and QLibrary that point to
the same file, we can't thread-safely set the error string.
[ChangeLog][Important Behavior Changes] QLibrary::resolve() will no
longer set or clear the error string based on the success of finding the
symbol. The error string will reflect the result of loading the library.
Change-Id: I46bf1f65e8db46afbde5fffd15e1a4f4c2713c17
Reviewed-by: David Faure <david.faure@kdab.com>
There was a race condition in accessing the cached instance factory
member, so rework loadPlugin() to return the cached or newly discovered
instance, with proper, atomic caching. Because I had to change that, I
took the opportunity to fix the QFactoryLoader code that calls
loadPlugin().
Note that QLibraryPrivate::loadPlugin() returns non-nullptr now if the
instance is known, which means the last return in QPluginLoader::load()
will convert to true, not false, if the instance got cached between the
earlier check and the call to loadPlugin(). That's probably what was
intended.
Task-number: QTBUG-39642
Change-Id: I46bf1f65e8db46afbde5fffd15e1a42d2b6cbf2c
Reviewed-by: David Faure <david.faure@kdab.com>
It has been reported that 7447e2b337
needs amending to build on MSVC 2019, although it was OK in CI.
Change-Id: Id22c2a3608529abebd66c0e8f401bc6f26f45e18
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
d7cb21ac08 change the way a double is
converted which resulted in less precision.
Fix it by explictily setting the precision in QString::setNum()
Task-number: QTBUG-80068
Change-Id: I1fd9d00837155ceb707e84bfeb9deff03b5ab57e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When _NET_WM_STATE_HIDDEN is not contains in the _NET_WM_STATE
window property, the window should not be considered to be minimized
According to
https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html
_NET_WM_STATE_HIDDEN should be set by the Window Manager to indicate
that a window would not be visible on the screen if its desktop/viewport
were active and its coordinates were within the screen bounds. The
canonical example is that minimized windows should be in the
_NET_WM_STATE_HIDDEN state. Pagers and similar applications should use
_NET_WM_STATE_HIDDEN instead of WM_STATE to decide whether to display a
window in miniature representations of the windows on a desktop.
For mutter/GNOME Shell, without _NET_WM_STATE_HIDDEN, window manager
will not reply XCB_ICCCM_WM_STATE_ICONIC settings in WM_CHANGE_STATE
client message.
Task-number: QTBUG-76147
Task-number: QTBUG-76354
Task-number: QTBUG-68864
Done-With: Liang Qi <liang.qi@qt.io>
Change-Id: Ic9d26d963979b7f0ef4d1cf322c54ef8c40fa004
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@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>