When building Qt we need to set QT_ANDROID_ABIS value to
CMAKE_ANDROID_ARCH_ABI explictily since the automatical detecting of
android ABI is not executed. This fixes build of the qtbase in-tree
tests.
Fixes: QTBUG-97133
Change-Id: Ica7057bcfcc8f4fe4b5a921ca7449f74cdbca0f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
- Under a list item, we've been indenting code blocks:
```
int main() ...
```
- But it's also ok *not* to indent (and github handles that better):
```
int main() ...
```
- There was a bug that when the code is not indented, the fence would be
indented anyway:
```
int main() ...
```
and that was not OK, neither for md4c nor for github.
Now with this change, either way is rewritable: you can read markdown
into QTextDocument, make small edits and write it back out again, with
the indentation being preserved (the code block is either part of the
list item, thus indented, or else it's outside the list completely).
Pick-to: 6.2
Task-number: QTBUG-92445
Change-Id: I5f51899e28ba9f09b88a71e640d9283416cce171
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Cocoa sends QWidget the state-change notification after the window has
been resized already, at which point we cannot store the normal geometry
anymore.
Handle zoom and full screen callbacks prior to the state changing
to store the geometry in QCocoaWindow. We do not need to handle
minimized state, as the window will still reflect the original
geometry.
Return the stored value from an override of
QPlatformWindow::normalGeometry so that QWidget gets the correct values
even though the new state is already active.
Fix the tst_QWidget::normalGeometry test to make it pass on all
platforms by waiting for the window to actually have transitioned to
the new state before comparing geometries. Both macOS and Windows fully
pass; on Xcb, deminimizing a window using setWindowState does not work,
which is why the test was partially skipped (confirmed by visual
testing). Move those problematic, complex test cases to the end so
that most cases are covered on Xcb as well.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.2
Change-Id: I518a5db9169b80e8fa25fe4fa2b50bd1ea0e6db3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Doing so results in bailing out early for a widget that hasn't been
shown yet, or otherwise resulted in creating extra and topextra,
which means the normalGeometry will not reflect the widget's geometry.
Pick-to: 6.2
Change-Id: Ieb85e9a6109ae34fe20d79e3c12f4517f827a590
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Simplify various conditions.
Eliminate duplication from an overly-complex if/else cascade.
Move the set-up of a QGraphicsSceneResizeEvent to only happen if it's
going to be used.
Change-Id: Ie51aa5de5f2bd1603478ae0cda0fd4279334f45a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Get rid of the gotos by packaging the wrap-up code in a QScopeGuard.
Thanks to Volker Hilsheimer for suggesting that solution.
Change-Id: I71bebf59263ce05f111d1fcfcec93f4635a35428
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Don't count "*", don't search for "[" and for "?"
inside m_pattern on every call to matchFileName().
Do it once, when constructing the MimeGlobPattern.
Fix matching the pattern for names without any
wildcard: index of question mark should be -1, not
just different from 0.
This shortens loading a Qt6 project in Creator
by about 500 ms.
Pick-to: 6.2 5.15
Change-Id: Ifa40c2cec4aba07a0312ef36877e571a8c8fb151
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Faure <david.faure@kdab.com>
QList::iterator is not a pointer and shouldn't be treated as one.
Convert the code to use iterators consistently (using iterators is
necessary due to the call to insert()).
Change-Id: I917b3ff6fdcf1f7959e35ac5b091a8140e9f833c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is a workaround for a problem in TextEdit.
The symptom is that when the user places the cursor inside
of a word and hits backspace, the last letter of the word
is removed instead of the letter just before the cursor.
The reason is as follows.
When stopping composing, the current cursor position has to
be maintained. To that end, QAndroidInputContext sends an
event containing the text to be committed and the cursor position
to the editor. But the resulting cursor position is wrong.
This patch adapts QAndroidInputContext to send two events:
One to commit the text, the second to place the cursor.
A real fix would fix the editor to correctly
handle the event containing both the committed text and
the cursor position.
Fixes: QTBUG-97491
Pick-to: 6.2 5.15
Change-Id: Idd00e5afcbfe29c9cb77356f9add2e881c51b9bb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
When swiping on a device to do the back gesture then there is no back
key pressed sent so we still need to catch when the keyboard is hidden.
So we can listen for the geometry change and if the height is less than
0 then it is safe to say it is hidden so we update the internal setting
on this.
Fixes: QTBUG-96560
Pick-to: 6.2 5.15
Change-Id: Iec0560935ef914d2cebcb7641a72ab4f71877d23
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
[ChangeLog][QtGui][CSS] The background-color style can now be applied to
<hr/> to set the rule color.
Task-number: QTBUG-74342
Change-Id: Ib960ce4d38caa225f258b6d228fb794cef43e1b7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The ICU UChar type is a UTF-16 type, not a single-byte type, so
passing it the data() of a QByteArray representing an ID is misguided.
Fixes: QTBUG-97486
Pick-to: 6.2 6.2.1
Change-Id: I6789f491674b1d913eb8655d788b497e2fc06f7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends 0c2125458a.
The code assumed that a QItemSelectionModel always has a model.
But during initialization from QML, it hasn't.
Fixes: QTBUG-97475
Pick-to: 6.2 6.2.1
Change-Id: Ie9c680f8989a23ef732faaf5da7ef7ae273126aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Document it here to let people know about the pitfalls with some
placeholder values. Link the QMessageLogContext class doc for more information.
Pick-to: 6.2
Change-Id: I8e7b4c0dcb8bceeeee645664c98e63ae7ca7e854
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Keeping the event loop busy with a zero-timer like
that is bound to cause trouble and highly erratic behavior of the UI.
Fixes: QTBUG-96869
Pick-to: 6.1 6.0 5.15
Change-Id: Idf02a7a7e0689c59e1223610a6525262ead56d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since commit 7ba75d0 we close the QWindow in QWidget::close for native
widgets and trigger the closeEvent in QWidgetWindow. However, if the
widget's window handle is not a top level window, QWindow::close()
will not close the window, failing in this way to deliver the
closeEvent and call the close handling in QWidgetPrivate::handleClose.
To fix, call handleClose() from QWidget::close for such widgets.
Task-number: QTBUG-74606
Pick-to: 6.2
Change-Id: Ied342eced3340aaf19b5443762935b1a5fc5c27b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We don't need to check FEATURE_ltcg, just add -fno-lto unconditionally.
That makes QtCore compile with -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON.
Change-Id: Icb2516126f674e7b8bb3fffd16ada2c71d7334aa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Being a test, I'm going to abuse operator-> on end() to check
that we get what we want (a pointer past the end).
Change-Id: I7ab8d017b0fe320018820eff336d496328ade481
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It only has a single call site nowadays.
Change-Id: I6f486dec51f76e1fb231fb7276bc8c856885bee1
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The signal is emitted from QGuiApplication these days.
Pick-to: 6.2
Change-Id: I7423cd4808e8df86960f225fd6e4a12a1a4f11f3
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The bugs we had noticed previously are believed to be fixed. MSVC will
do per-function updating of AVX content where necessary and the ICC
issue is no longer relevant.
Change-Id: I2bbf422288924c198645fffd16a9235f2d73cc19
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This hasn't worked for some time. It's not in our CI and I don't think
it was working at all. When I tried to build it, I ran into several
problems with C++17 and an Internal Compiler Error I did not have any
interest in working around.
After discussing with the Intel compiler team, it was decided that
fixing those issues in the old compiler is not going to happen. Instead,
their recommendation is to adopt the new LLVM-based compiler, which
the last commit added support for.
This commit does not remove qmake support for the old ICC. It's possible
someone is using qmake with a non-Qt6 project and ICC.
Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This includes a few cleanups to our .cmake files where it was easier to
combine existing sections of Clang / AppleClang that no longer needed to
be distinct.
icpx could be replaced with a shell script:
exec `basename $0`/clang++ --intel "$@"
tst_qnumeric is not passing
FAIL! : tst_QNumeric::classifyF() Compared values are not the same
Actual (qFpClassify(tiny / two)): 2
Expected (FP_SUBNORMAL) : 3
Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(344)]
FAIL! : tst_QNumeric::classifyD() Compared values are not the same
Actual (qFpClassify(tiny / two)): 2
Expected (FP_SUBNORMAL) : 3
Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(344)]
FAIL! : tst_QNumeric::floatDistance(denormal) Compared values are not the same
Actual (qFloatDistance(from, stop)): 0
Expected (expectedDistance) : 4194304
Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(408)]
FAIL! : tst_QNumeric::doubleDistance(denormal) Compared values are not the same
Actual (qFloatDistance(from, stop)): 0
Expected (expectedDistance) : 2251799813685248
Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(408)]
P
Change-Id: Icb2516126f674e7b8bb3fffd16ad59431e8c3379
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use the predefined logging category for clipboard warnings
and change the offending warning to qCDebug() so that it is silent
by default.
Pick-to: 6.2 5.15
Fixes: QTBUG-60257
Change-Id: Icf1bc84cd64207b94ef471f13090c43b45e20728
Reviewed-by: Liang Qi <liang.qi@qt.io>
The ranged constructor for QList has an optimization when the
iterators are QList's own iterators. In that case, it uses a
"contiguous append" shortcut by converting the iterators to pointers.
Avoid that conversion by extracting the pointers from the iterators.
Note that this is an optimization for C++17 only; in C++20
appendIteratorRange will deal with this case as well. Leave a note.
Change-Id: I761c36ff500dee95b4ae1b0a4479d22db0c8e3de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Do not rely on implicit pointer->QList::(const_)iterator conversions.
Amend QList's own code so to avoid them.
Change-Id: Ia3e7a83631943e636831217cdad28b73c98c1dc7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The use of ndk.dir in local.properties is deprecated in favor of
android.ndkVersion in build.gradle, and will be totatlly removed in
the future, so we need to adapt to that.
Fixes: QTBUG-91391
Pick-to: 6.2
Change-Id: I54c57113a759d43c3685c9cdf2b9dcc5c948c0fd
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
QAbstractScrollAreaPrivate::layoutChildren() positions the viewport, but
did not take the overshoot from scrolling with a scroller into account.
If the scroll area was resized during a scroll, then this resulted in the
roll back overcompensating for the overshoot, placing the viewport outside
the visible area.
Fix this by taking the overshoot into account when positioning the
viewport.
Add a test case. We have to use QWindow-based mouse event simulation, as
the QWidget based move events use QCursor::setPos, which doesn't reliably
go through the gesture framework.
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Done-with: Zhang Hao <zhanghao@uniontech.com>
Fixes: QTBUG-94769
Pick-to: 5.15 6.2
Change-Id: Idf650c91e5a9cffa996e23e743939243b1d4fcc0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
MoltenVK installed from homebrew has the following
directory structure:
molten-vk/1.1.5/libexec/include/vulkan/vulkan.h
molten-vk/1.1.5/include/MoltenVK/mvk_vulkan.h
Task-number: QTBUG-80576
Pick-to: 6.2
Change-Id: If6f5aeb55908f60fff49417ee1ddf4c2db980c5a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The local position needs to be corrected when the Qt receiver window
does not correspond to the native event receiver window.
Fixes: QTBUG-97095
Pick-to: 6.2 5.15
Change-Id: Ic9fa3d84b6ee84ae5f8fa2408b0d60e35dbfa328
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Emscripten complains that this variable is deprecated and should be
replaced with the one given in this patch.
Change-Id: Iafee06fcb1f292de25570545d74d7327679461b0
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
There's no need to dereference+reference a QList's iterator
only to pass the result to an algorithm, just pass the iterator.
Change-Id: I7367010f6ab489d951715259bd51aeec790d3c84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This define used to be set for the entirety of the Qt build but
was lost during the qmake->CMake transition. Re-enable it.
Change-Id: Idc4cb6ada485158559485b60f62f76439550b255
Pick-to: 6.2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Currently using nested Q_FOREACH loops produces warnings about
shadowing local variables (if enabled). For example, this code:
QList<int> aList;
QList<int> bList;
foreach (int a, aList) {
Q_UNUSED(a);
foreach (int b, bList)
Q_UNUSED(b);
}
produces the following warning with MSVC:
warning C4456: declaration of '_container_' hides previous local
declaration
This is due to using variable _container_ as loop variable for both
loops.
This patch appends current line number to the name of the loop
variables so that most of the uses of Q_FOREACH will not result
in shadowing.
The patch originally by Benoit Regrain.
Fixes: QTBUG-79081
Pick-to: 5.15 6.2
Change-Id: I55235e917e920171b138c8b3239a95dfe2ac7988
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This amends commit 165e01d5d5.
Above commit broke the code that adds "${PROJECT_SOURCE_DIR}/cmake" to
CMAKE_MODULE_PATH. The semicolon that separates entries of
CMAKE_MODULE_PATH must be escaped. Otherwise, the semicolon separates
elements of the flags list.
Additionally, fix the QT_AVOID_CUSTOM_PLATFORM_MODULES code path which
lacked the addition of "${PROJECT_SOURCE_DIR}/cmake".
Pick-to: 6.2
Change-Id: I72f78cf066cabe6b0002dce1aa0294aa0dc9cbf0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Do not read the target property LINK_LIBRARIES from interface libraries
as this leads to errors with CMake 3.16.
This amends commit 326b91ea78.
Pick-to: 6.2
Change-Id: I44251c7633d5ecd977cd05746ac311dd1285d1e3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It is unsupported with clang-cl and breaks the build.
This is a fixup for:
51e8d3592a Let QLocale::uiLanguages() use WinRT API when possible
Task-number: QTBUG-94341
Pick-to: 6.2
Change-Id: Icf32339e81d67d4c119b7fb8d8d834c744b9ead0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This was handled correctly when the backend supplies transitions
bracketing the time in question, but the fallback code tried to use
the DST offset at the time with larger offset from UTC; this did not
work when the gap was due to a change in standard time. Discovered by
ANS1 parsing of a date-time with two-digit year, for which the
date-time parser tried to use 1921-05-01T00:00 local time when filling
in the fields it had parsed; but, when run in Europe/Helsinki, there
is no such time due to the 20m 11s skipped when joining EET from the
prior local solar mean time.
Correct the calculation to use the actual change in offset from UTC,
as used in the (far better tested) between-transitions branch of the
code, rather than the DST offset after the transition.
Add a test-case based on the ASN.1 certificate date whose parsing
revealed the issue. Although it seems nothing in Coin can reproduce
the issue, the reporter has verified that the test does indeed fail on
the system where the bug was found and the fix does fix it.
Fixes: QTBUG-96861
Pick-to: 6.2
Change-Id: I12b02bad01daca2073d1a356452cd573684aa688
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When adding resources generated via a custom command, the project fails
to configure when targeting iOS with CMake and Xcode with the error:
CMake Error in src/CMakeLists.txt:
The custom command generating
src/.qsb/TestShader.frag.qsb
is attached to multiple targets:
TestApp_other_files
TestApp
but none of these is a common dependency of the other(s). This is
not allowed by the Xcode "new build system".
This happens e.g. when using qt6_add_shaders, which adds a custom
command to generate the qsb files. Or by simply adding resources via
qt6_add_resources, which depend on a custom command.
The problem is that qt6_add_resources also adds the resource to a
second "fake" target ${target}_other_files via
_qt_internal_process_resource and _qt_internal_expose_source_file_to_ide.
See c7d1874cd1.
Since these targets do not have a common dependency CMake fails to
configure the project.
So lets fix it similar to change 1bd0a5ce02352a600367beb5a5421c8f8332e1fe
and let the ${target}_other_files depend in the main ${target}.
Pick-to: 6.2
Task-number: QTBUG-95763
Change-Id: Iecdb40993a91da8bfbf6553892f9b0722d2e886c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When parsing CSS, a border-color value is parsed as four brushes, as css
allows assigning up to four values, one for each side.
When applying the CSS to the HTML, we accessed it as a color value,
which overwrote the parsed value with a QColor. So while we had a valid
parsed value (and didn't re-parse), the code accessing that value still
expected it to be a list, and thus failed to retrieve the data.
There are several ways to fix that, but the cleanest way without
introducing any performance penalty from repeatedly parsing (and in fact
removing a parse of the string into a color) is to enable colorValue to
interpret an already parsed value that is a list without overwriting the
parsed value again. To avoid similar issues in the future, add assert
that the parsed value has the right type in brushValues.
As a drive-by, speed things up further by making use of qMetaTypeId
being constexpr, which allows for it to be used in a switch statement.
Add a test case.
Fixes: QTBUG-96603
Pick-to: 6.2 5.15
Change-Id: Icdbff874daedc91bff497cd0cd1d99e4c713217c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>