Add a special case for handling Qt::WindowMaximized and
Qt::WindowFullScreen which don't call QPlatformWindow::
initialGeometry(). Handle the case by setting window
geometry to be equivalent to available screen geometry.
This avoids any rounding errors introduced by scaling
available screen geometry by a (possibly) fractional
scale factor.
Task-number: QTBUG-87334
Change-Id: Ia1b96057bdf3d3787f1b77b81078856fdd33fe9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
m_window->size() may have been rounded for devices
with DPI which results in a fractional DPR (e.g.
650 DPI / 160 DPI = 3.5 DPR). In this case scaling
by devicePixelRatio does not give the correct result.
Instead, use QPlatformWindow geometry and DPR to determine
the device size, without using the (possibly) rounded
device independent window size.
Fixes: QTBUG-87334
Pick-to: 6.6 6.5 6.2
Change-Id: I280236a06516cdb2a1a259fd0cfa8084c1ce7f46
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
GCC, in particular, doesn't understand that the types are
fundamentally the same unless you compile with -O3, so help the
compiler by using bit_cast when it is available.
GCC now produces the same code at -O2 as previously only at -O3. Still
no tail-calls, though.
Task-number: QTBUG-118913
Change-Id: Ib1241a98f1de49c59a2e16b7d1f5cf813db4edf7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
In particular, match the value of ::unordered to each std library
implementation.
Legal disclaimer:
The values were provided to this author in a comment on QTBUG-118913.
This author hereby confirms he didn't look at any of the
implementations himself. The stdlib detection macros are taken from
existing code in qcompilerdetection.h. I didn't succeed in googling a
corresponding marker for MSSTL, and I didn't look at the
implementation or Boost.Config to find one, so this patch just assumes
MSSTL as a fall-back, which is probably wrong, since we may still have
Dinkumware and RougeWave STLs to deal with on embedded platforms.
Add tests to ensure the values are the same on all platforms.
To maximize coverage, rename qcompare.qdoc to qcompare.cpp and add a
bunch of compile-time tests there. These depend in part on bit_cast,
which we cannot depend on, so tst_qcompare contains the same tests
using memcpy.
Fixes: QTBUG-118913
Change-Id: I46c922c8e3ea37d7c01a71361c7a689340f9047d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This amends 944200b5a9 and the follow-up
commit 84e70976f3. We have too many use
cases in Qt where we construct a QJniObject from one thread, and access
it from others. Remove the overhead of checking and warning about the
mismatches.
The responsibility of guarding access to the underlying Java object, by
using MonitorEnter/Exit or synchronization blocks in Java, is with the
caller.
Change-Id: Iadbc9af0476009f2d43ecdd3d8f1335f31a04446
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
For an unscoped enumerator, e.g.:
namespace N {
class C {
enum E { F };
};
};
N::C::F and N::C::E::F are equivalent and key(s)ToValue should match
both.
This already works for scoped enums because the name of the enum can't
be dropped.
Fixes: QTBUG-118240
Pick-to: 6.6
Change-Id: I84d7bbb7aa8f82b2a7c2bc7e4edd5d77d37335c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
PE_IndicatorArrowUp/Down/Left/Right was drawn using integer coordinates
for the three edges which lead to artifacts in high-dpi mode. Fix it by
using QPointF instead.
Pick-to: 6.6
Fixes: QTBUG-114539
Change-Id: I03cbff2ef789e8cee0f3a0d84138d94516340669
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Remove dead code from tst_qstatictext as proposed in the bug report.
Fixes: QTBUG-22424
Change-Id: Id0916cba75eb7c7a21c61c078d94470b143d0f24
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The loop doesn't modify the member QHash.
Pick-to: 6.6 6.5
Task-number: QTBUG-115803
Change-Id: I77704b5c90b25a82006004907b4591e783096594
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Including <sys/mount.h> in qstorageinfo_linux.cpp broke -unity-build's
in which qfilesystemengine_unix.cpp (which includes <linux/fs.h> which
in turn includes <linux/mount.h>) ends up in the same unity_cxx_nn.cpp
as qstorageinfo_linux.cpp.
MS_RDONLY is a macro in one header and an enum in another, when both are
in the same TU that's UB. This was fixed[1] upstream since glibc-2.36,
but it's still an issue in Ubuntu 20.04, which has an older glibc IIUC.
So, just inlcude <linux/mount.h> which works on Android too (according
to precheck CI on gerrit).
Amends b3eb951d18.
[1] https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
Task-number: QTBUG-119328
Change-Id: Ifa02272eea004051dd329b35f533385813215bfc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Increased due to qsizetype.
Pick-to: 6.5 6.6
Change-Id: I85b3fc2dd45c4693be13fffd179662c8b898fb79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
They've been a long time coming. I had them in TinyCBOR before the
chunked reading; in fact, I added the chunked reading specifically for
Qt's CBOR support.
[ChangeLog][QtCore][QCborStreamReader] Added toString() and
toByteArray(), which read a full string whether it is chunked or
not. They also guard against attempting to allocate more memory than the
underlying stream could provide.
Change-Id: Icfe44ecf285a480fafe4fffd174c5815f153d5b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
[ChangeLog][QtCore][QCborStreamReader] Fixed lastError() not being
declared as a const member.
Change-Id: Ib1d2fc7100134f7597cdfffd174a8401b43576d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It was always overwriting the QString, while readStringChunk_byte() was
appending to the QByteArray. The appending was used by QCborValue, which
appends byte and text strings to its QByteArray in QCborContainerPrivate, but
keeps the UTF-8 encoding for simplicity sake.
I will need the QString appending for the next commit.
Change-Id: Icfe44ecf285a480fafe4fffd174c6a89e91cef74
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
OpenSSL 1.1 reached EOL last September [1]. We will only support
OpenSSL 3.
Cherry-picking aggressively, as there's no purpose at keeping maintained
Qt versions work with an unmaintained library given the security
implications.
[1] https://www.openssl.org/blog/blog/2023/09/11/eol-111/
[ChangeLog][QtNetwork][SSL] Support for OpenSSL 1.1 has been dropped. Qt
now only supports OpenSSL 3.
Change-Id: I51a231a9ca17804739acbd2f22c478d2a8ff9b3b
Fixes: QTBUG-119330
Pick-to: 6.6 6.5 6.2 5.15
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
There's no point to the file if it has no content.
Change-Id: Ie0deb59a63d5f7a654fcab1218e0a814710072ff
Reviewed-by: Jason McDonald <macadder1@gmail.com>
The MS TZ-backend's lookup of available Windows IDs included a TODO
advocating caching the result, since it is unlikely to change at
runtime. Given that MS's time_t functions don't believe in times
before 1970 and two-digit year parsing (such as the ASN.1 parser does,
apparently many times, during SSL handshakes) assumes the 1900s (and
certs in use today have mostly been issued this century), SSL involves
DTP falling back repeatedly to lookups of local time's offsets from
UTC (before it discovers it shouldn't have been using local time
anyway) via the system timezone object, this cacheable list can be
accessed many times. (A user has reported thousands per SSL socket
created.) So let's implement that TODO and trust that updates to the
registry's set of available zones aren't a common occurrence at
runtime.
Pick-to: 6.6 6.5
Change-Id: Iefe235c71da1bf5c3372c52dba89ad0657e06c0b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When qtbase + qtools is built with -DCMAKE_INSTALL_PREFIX=/opt/foo
and then qtsvg is built with -DCMAKE_INSTALL_PREFIX=/
building docs will fail to find the installed .qdocconf files with an
error like:
qtsvg/src/svg/doc/qtsvg.qdocconf:1: (qdoc) error: Cannot open file
'//doc/global/qt-module-defaults.qdocconf': No such file or directory
That's because we pass QT_INSTALL_DOCS=/ (pointing to the new prefix)
as an env var to qdoc and it uses that to try and include various
qdocconf files.
Instead of passing the currently specified CMAKE_INSTALL_PREFIX, use
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX which points to where
qtbase was installed (and thus all previous .qdocconf files).
This was already in the code but we preferred CMAKE_INSTALL_PREFIX
when it was set, so just remove it.
Pick-to: 6.6
Change-Id: Ibe326132b9504341fa998d9e772ea2bea79727c0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The same test code is compiled by two different modules' tests, which
won't be obvious to the reader of the code unless it's pointed out
explicitly.
Change-Id: I99dba6eb186939c372636c5c1fc29799003d32a7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Although the days in month for a year might be affected by century (if
last two digits are 00), actualDate() has at least set the year to its
best guess, which will give the right days in the month at least 99%
of the time. So take year into account if either year field is set.
Adjust a comment's position so that it's clear it's referring to the
two-digit case, when (at first sight perversely) using 9999 as the
field's max value (it's the datum controlled by it that matters,
here).
Task-number: QTBUG-46843
Change-Id: Iebebe4b2617eb0820ec57398a774b70bf2ae0898
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Previously setting a range on the QDTP that excluded 1900 would have
lead to using a default value outside the QDTP's valid range. This did
not arise in practice (QDTE supplies its own defaultValue, which is in
range, and QDT/QLocale's use of QDTP don't set a range). However, I
now want to give callers some control over the century used in
two-digit years, which shall mean they can select the defaultValue's
year; and we'll still need to ensure this is in range.
Task-number: QTBUG-46843
Change-Id: I3884853dc1d2775e1049c25f208d90b8a363d0a7
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Ignore the 'inline' in case of nested namespace with another
nested inline namespace.
Amends 5222df2be7
Fixes: QTBUG-117765
Pick-to: 6.6 6.5
Change-Id: I87f2649606f63c818f225f8cc5ec914920763c5f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This the API that has been around since Qt 4.5. We decided not to
deprecate them individually. Instead, we'll deprecate the whole class.
Pick-to: 6.6
Change-Id: Ia930b1a2ed1e465a826ffffd179a1b7b3250fd89
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
No one is using that return code, instead print an error when the
call to startQtAndroidPlugin() fails.
Task-number: QTBUG-118077
Change-Id: I98c8e4ca9af5f1c45af36044336d461bed6acdc9
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
this makes it more visible in the build when introduing
or having java code that for example might be doing
something wrong. deprecation option can't be added at this
point since we compile the java code against the max
supported version and that will always print a lot of
deprecation warnings that are valid for the max version
but not valid for the min supported version.
Task-number: QTBUG-118077
Change-Id: I7d1e9c80d5208817a342cc1d79a28f233feeda0e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
use -classpath instead of -bootclasspath param to allow
javac to use the default boot class path to support
building lambdas, pass the user Android class via -classpath.
Task-number: QTBUG-118077
Change-Id: I1ba8274d57e1bd528a1d5b7d779191e7f1412184
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Fallback font determination did not take locale into account when
Japanese locale was used. Android devices show Chinese fonts instead.
Fixes the problem by prepending japanese defaut "Noto Sans Mono CJK ..."
type font before other fonts. Does same for Chinese and Korean locales.
Fixes: QTBUG-111528
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I70994c0059c3819eeb09dacb9bbe6634490ecf37
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Try to use the Downloadable Font APIs from AndroidX to download the
Material Symbols font. This would ideally allow us to add the official
icon variations dynamically to the device's font cache.
This works for several fonts from Google Fonts, but not for the fonts
we need. So, for the time being, add a path where we consult the
resource system for an embedded font file as well. Then an application
can add e.g. the font file for the desired icons variation, and Qt will
use those glyphs to render icons. Do this in the manual test, using
cmake's FetchContent feature to download the font from Googlei's github
repository.
The incomplete mapping is based on the standard Material icons
documentation at https://fonts.google.com/icons. We could in theory use
the `codepoints` file that comes with the font files to create the
mapping, but then we'd end up with platform specific icon names.
Task-number: QTBUG-102346
Change-Id: Ibff3fe6d310a388e6111d983815ef0ddffb684c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Broadcasting is only supported with IPv4. Previously set AnyIPProtocol
was handled the same as IPv6, which does not support it, so system
library was returning error code and initialization was failing.
Task-number: QTBUG-115777
Change-Id: Iefb1c7237d18cd7af7ccd53f7e5f3f5749a12fd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QPainter was clamping the DPR at 1, which makes Qt paint
a blank window when the DPR is less than 1. Fix by
not clamping and treating only DPR == 1 as a special
case.
This is particularly relevant on Qt for WebAssembly
where the user can set the page scale to a value less
than 100%.
Fixes: QTBUG-111787
Change-Id: Iaa1f7a9b7837dd933c28380b5049422dc1ce9657
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
By "off-primary-screen" here I mean windows which are visible on
more than one screen, e.g. a secondary screen in addition
to the primary screen.
In this case the call to QHighDpi::toNativeGlobalPosition(pos, this)
problematic, since it uses the scale factor for the primary
screen, while pos might be on the secondary screen.
One way to fix this is to look up the correct scale factor
based on pos. Another way is to realize we don't have to
use scaling to get the native window position, and get
it from platformWindow geometry. This patch implements this
fix.
Fixes: QTBUG-106695
Change-Id: I03ffc261e199f65e54b06b964d067b6a9e0dd021
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add Q_ENUM to StandardButton and ButtonRole.
Add static assertion to enforce sync with QDialogButtonBox.
Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I38a7367d6287ab7fa5e5ca0c94ea6daa0f95fc52
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Wrap the activity and service static objects with
a WeakReference to fix a potential memory leak warning.
Task-number: QTBUG-118077
Change-Id: Ifafd137cc49ec5ea23d8425b6bd58b43573970b9
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
The problem occurred when we moved the cursor to the penultimate
character of the string, because the boundary condition was wrong. It
is important to realize that the offsets are moved *between* each
character (and also before and after the whole string), just like you
would move a cursor. This means that the offsets can be in the range
[0, len] (closed interval)
The problem could only be reproduced with JAWS.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-115156
Change-Id: I0c5f05fa391e6c7744ab22d71afe8904b49e89bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
When changing the tab position, the scroll offset is calculated wrongly
because the calculation is done before the size of the tabbar is
recalculated. Therefore wait until QTabBar gets the resize event and
calculate the new tab positions there.
Pick-to: 6.6 6.5
Fixes: QTBUG-119366
Change-Id: I261a91bb584409b9b0dac4339a32894f47540bcf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the drilldown example:
- use icons with the current style
- remove unneeded QOverload<>
- remove some empty lines which don't look good in the documentation
- use Q_SLOTS/Q_SIGNALS instead slots/signals
Fixes: QTBUG-113696
Change-Id: I62476a8989c0abd1f424d1425cb05489491e2153
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QComboBox in non-editable mode passes all keyboard input to the internal
item search. This was done regardless if the character is printable or
not and therefore e.g. '\t' composed by Key_Tab + ControlModifier was
accepted and not passed to the parent (in the bug report to the
QTabWidget which could not switch tabs due to that).
Pick-to: 6.6 6.5
Fixes: QTBUG-118605
Change-Id: If39423587460a70231c735df4912b72c5ae77475
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
dbus is not supported on VxWorks
Task-number: QTBUG-115777
Change-Id: Ia594ddca819ade2d5004dde3da59717e4735b823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>