The pre-existing test for QLocalServer was testing only a minor subset
of cases, so replace it with the call to
QTestPrivate::testReadWritePropertyBasics.
The test for QLocalSocket's bindable properties was missing, so add
it.
The new tests didn't reveal any problems.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I695bb050d39eeae9ffb84c097c36601a4ca89af6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The pre-existing tests were not using the QTestPrivate helpers, so
extend them with the call to QTestPrivate::testReadWritePropertyBasics.
The updated test didn't reveal any problems with binding loops, so no
other action is required for now.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I51a17974a7f5bec3c969fcb55b6f28e3e9218eb5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The pre-existing tests were not using the QTestPrivate helpers, so
extend them with the call to QTestPrivate::testReadWritePropertyBasics.
The updated test didn't reveal any problems with binding loops, so no
other action is required for now.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I360614a40fe2bacb796051607ed67e7e666b4f22
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The bindable property tests were not using the QTestPrivate helpers, so
add a new test which uses them.
The new tests revealed a binding loop for the interval property.
Fix it in a usual way by explicitly removing the binding and using
{set}ValueBypassingBindings() in the setter.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: If94f57938da449a68e3527aead5ebd55ba410adb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The old tests were not using the test methods from QTestPrivate, so
add another test case.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I291ede26461e79a615630f1decad2ad7549b4dd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
... by using valueBypassingBindings() when accessing the properties
from the setters.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: Ibbad552fa1e611f4bb704b4e47667df5f328f152
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
... by using valueBypassingBindings() when accessing the properties
from the setters.
This commit is mostly trivial.
Had to change the template parameters in the unit-test, because the
updated QTestPrivate::testReadWritePropertyBasics() creates an instance
of the TestedClass, and QAbstractProxyModel cannot be instantiated,
since it has pure virtual methods.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I0cae29263ea9bb92c9de06891b0ba8633fb9fd72
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
... by using valueBypassingBindings() when accessing the properties
from the setters.
The most complicated case here is the currentTime property, because
its setter was calling the public currentValue() and currentFrame()
methods. Both methods are reading the same currentTime property.
Fix it by replacing the calls to these methods with the calls to
valueForTime() and frameForTime(). Both take an int parameter, so
the updated code can use valueBypassingBindings() to pass the current
time to these calls.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I5c3a05f3e21e4c9e53ed98c9f8d1dce76e40a00d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The bindable property tests should use the helper functions from
QTestPrivate.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: Ie1a61ab80e6f737eac02246214c2c93129a1cf94
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Extend the unit-tests for bindable properties and fix the discovered
binding loop by using {set}ValueBypassingBindings() in the setter of
the duration property.
The code refactoring does not modify the setter logic, because
previously the binding was anyway implicitly removed when calling the
assignment operator. The updated code just does it explicitly.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I0f339d182efb60500ee7f12e407f200d739da312
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Rewrite the logic of the setters to use removeBindingUnlessInWrapper()
and {set}ValueBypassingBindings() calls.
The logic of both setters didn't change, because previously the
pre-existing bindings were implicitly removed when calling the
assignment operator.
The new code just makes it explicit.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I475e6cd65fc73796176f257835cb67b9e70a1e34
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
... by using valueBypassingBindings() when accessing the properties
from the setters.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I04abc394f4406dc0fa75c55a9093e10c27a20c30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Extract literal to constexpr function and reuse it
Change-Id: I0a1ec24cb67e413222c826f2f26d78e16459ff8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reduce allocations by usage of case insensitive compare method
While touching code, reorder condition to use cheap int compare first
Change-Id: I01a5d18ae69658a9cd1c27b40a9cdf369231b5fe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
ifstream may block the file descriptor in some operating systems.
Wrap the reading of files in staging directory with extra scope,
to make sure that ifstream closed the descriptor before the removal
attempt. Also make sure that we closed the ifstream explicitly.
Pick-to: 6.5 6.6
Change-Id: I56ef5e9925501912d5cd61e8545f664e0a0d90b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Remove indirection via _q_newConnection() because the server object
may not exist anymore when this method is invoked.
This amends commit d865e3ef1d.
Task-number: QTBUG-116621
Change-Id: I5f9a667bc0e2e3cd36492c24767505031fe0e1d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
libstdc++'s std::filesystem::path implementation incorrectly assumes
that any 8-bit char input is UTF-8, when it patently isn't on Windows.
Reported at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111244
Pick-to: 6.5 6.6
Fixes: QTBUG-116609
Change-Id: I2b24e1d3cad44897906efffd17803f2862935c9b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It was only used to provide a CMake-time error instead of a build-time
error. That cost us 250 ms of CMake time, even if you had double-
conversion turned on. Instead, let the build fail for people who turn
off libdouble-conversion.
Change-Id: Ifbf974a4d10745b099b1fffd177757570c5575eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's very hard to debug a macro.
Pick-to: 6.5 6.6
Change-Id: I2b24e1d3cad44897906efffd17803b8eac9bd844
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Added by commit b42a2b3c33 for 6.0, but we
forgot to document it.
Pick-to: 6.5 6.6
Change-Id: I2b24e1d3cad44897906efffd1780086b51c0e3fa
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
No raw loops. Also de-duplicate functors by lambda generator
Change-Id: I053890a0a472bfe2846d7007fda8cca779d812a8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Accessibility implementations rely on correct information about the
model dimensions when operating on item views. An item view that has a
root index set needs to report it's size based on the root index, rather
than for the view's model directly.
Pass the rootIndex to all calls to QAbstractItemModel::column/rowCount.
Refactor the code to avoid excessive dereferencing of a QPointer, apply
const and fix/improve coding style in touched lines.
Emit a ModelReset notification when the root index changes, or (in the
case of QListView) when the model column changes.
Split long Q_ASSERTs into multiple lines to be able to better trace the
exact reason for an assertion, and replace the assert with an early
return of nil when it's plausible that a cached cell is no longer part
of the view (i.e. because the root index changed).
Add a test case that verifies that changing the root index changes the
dimension of the view as reported through the accessibility interface.
Pick-to: 6.6 6.5
Fixes: QTBUG-114423
Change-Id: I7897b79b2e1d10c789cc866b7f5c5dabdabe6770
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Without adding the corresponding properties, they will not be available
in QML.
Task-number: QTBUG-116106
Pick-to: 6.6
Change-Id: I233e456ced585b9274a1724cc550bc2959757104
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Installing a second mimetype with *.txt as glob had a different
effect depending on whether it was installed into the same prefix
or a different prefix as the one where text/plain is installed.
Pick-to: 6.6
Change-Id: I7f54b8efe22f620eb57257745c48fe5402c87626
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If we configure module that is already installed it's expected that
tests use the build directory to resolve all the depdencies, but not
the install directory. This is especially sensetive if the module cmake
scripts were changed.
This changes the order of find_<package|dependency> PATHS that are
used to locate Qt package. QT_EXAMPLES_CMAKE_PREFIX_PATH now is used at
first, so we guarantee that we look into the build directory at
first place. This trick only works if build directory is added to
CMAKE_FIND_ROOT_PATH. The reason for that is the internal CMake logic
that tries to relocate the search PATHs and put the paths that are
subdirs of or exact CMAKE_FIND_ROOT_PATH higher in search list.
Fixes: QTBUG-115730
Change-Id: Icab721f0a6eac7301c626350ab214cc4545b368b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QTextMarkdownImporter::import() took a QTD* as if it would be ok to
reuse one instance of QTextMarkdownImporter for repeated importing into
different documents; but in practice, we never do that: in fact it's
usually a short-lived, stack-allocated object, as in
QTextMarkdownImporter(&doc, QTMI::DialectGitHub).import(input);
So it's less clumsy internally to require the document be provided to
the constructor: that way a QTextCursor can be constructed immediately
too, as part of the importer object rather than separately on the heap.
This is private API, unused outside qtbase.
Change-Id: I8041ceb33cb7e7608df55dc5a963292c585afb90
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Q_QDOC sees all values, and is going to document different
values than what Q_OS_WASM sees.
Set the values explicitly instead, and make each
value unique in order to avoid confusion.
Change-Id: I0a2ddf10652be78d5b80c486261199d0d7ed5c84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends 7a0de7fda2.
qsettings.cpp:2385: (qdoc) warning: No such enum item 'WebLocalStorageFormat' in QSettings::Format
qsettings.cpp:2385: (qdoc) warning: No such enum item 'WebIndexedDBFormat' in QSettings::Format
Change-Id: I2b24e1d3cad44897906efffd17805aadd3bd11dc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The 6.5 versions of the overload not taking a context/receiver object
were constrained by requiring a functor to be free function or lambda.
207aae5560 removed that constraint, which
might be source incomaptible if wrapper functions in user code forward
the constraint using Expression SFINAE. Those wrappers would no longer
be removed from the overload set based on the same criteria as the
function they wrap.
We can't constrain the new functions based on the same predicate as
before, as after the simplification we have only one overload with, and
one without context object. But we can still remove overloads for
incompatible functors.
Add the respective scenario to the QPermission test as a compile-time
test.
Found during 6.6 header review.
Pick-to: 6.6
Change-Id: Id21391b4a6b78a29de2f8fa04374f4262e5fafa7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Take a copy of the d->childWindows container because each loop body
may end up directly/indirectly calling QCoreApplication::sendEvent()
which means unbounded/unknown code could be invoked causing recursing
into the class, leading to modifying the childWindows container while
iterating over it.
Pick-to: 6.6 6.5
Task-number: QTBUG-115803
Change-Id: Ib62ba38700e8862940ba98fdeb663dd730ff125f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
On VxWorks READ is defined as 0 and WRITE as 1
this causes issues with moc and Q_PROPERTY
that are manifested as parse errors
Task-number: QTBUG-115777
Change-Id: I9ea971507fa30390affb8b6865bfde04e8fd5a7d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
...to set m_o to nullptr and prevent an existing QSignalBlocker from
touching the QObject, which it was created for.
Add documentation and implement an autotest.
Change-Id: Ic18e80af5a57df1928f9d36aa0ab7ad79b6525fd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Private libraries were linked conditional to QT_FEATURE_private_tests in
the CMake file. qstatictext_p.h was included conditional to developer
build. A developer build fails, with test enabled and private tests
disabled.
=> Change the CMake condition to QT_FEATURE_developer_build, to resolve
mismatch between CMake and cpp file.
Pick-to: 6.6 6.5 6.2
Change-Id: I79213e7d3c38851b8b80cb8ab248d7bff750c227
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
QLabel *l is declared uninitialized, assigned in a for loop. The last
object is deleted for testing purposes.
This leads to a false compiler warning about deleting a potentially
unintialized pointer.
=> initialize with nullptr to silence the warning.
Pick-to: 6.5 6.6
Change-Id: I1422b04fc1fdbfc7248de577884aabfb539f3f4b
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Private libraries and WrapOpenSSL were linked conditional to
QT_FEATURE_private_tests in the CMake file.
qsslkey_p.h and open ssl symbols were included conditional to developer
build. A developer build fails, with test enabled and private tests
disabled.
=> Change the CMake condition to QT_FEATURE_developer_build, to resolve
mismatch between CMake and cpp file.
Pick-to: 6.6 6.5
Change-Id: I3ac93b02701e467a0b548c35d441d35a45c4568b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QItemSelectionModelPrivate::initModel() uses string based connections,
to connect/disconnet its QAbstractItemModel.
The QObject::destroyed signal is connected to modelDestroyed(), which
does not disconnect other signals.
QQuickTableView's selection model binds to its QAbstractItemModel.
The binding also reacts to QObject::destroyed
Eventually, QItemSelectionModel::setModel(nullptr) is called.
At this point, only a QOBject is left from the QAbstractItemModel.
That leads to warnings about disconnecting string based signals, which
belong to QAbstractItemModel.
This patch changes the connect syntax to the QObjectPrivate::connect
API. Instead of keeping a list of string based connections around, the
connections themselves are kept in a list member. Disconnecting happens
based on that list.
Connections are also disconnected in
QAbstractItemModelPrivate::modelDestroyed.
An auto test is added in tst_QItemSelectionModel.
Fixes: QTBUG-116056
Pick-to: 6.6 6.5 6.2
Change-Id: I57e5c0f0a574f154eb312a282003774dd0613dd6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The example keeps around image file names only and append
them to the selected dir path, that works fine for file
scheme files, but for Android with content scheme files,
that doesn't work as good because usually the paths are
returned by a provider and managing them manually like
appending a file name to a directory (tree) path might not
work.
This patch retrieves QFileInfo objects and use the absolute
file paths to open any image.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-116181
Change-Id: I9911a181d92ba0452500398cbe052b9583bd79a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>