Commit Graph

38928 Commits

Author SHA1 Message Date
Sze Howe Koh
ee2ac8b4ef qt_pixmap_thread_test(): Simplify logic, merge warnings
Pick-to: 6.2
Change-Id: I0c413c14d124bafbd6b2bd94d7a128e19ed83ade
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-09-06 22:56:56 +08:00
Volker Hilsheimer
e9e8d67e31 Fix segfault when closing widget and destroying window in QDialog::done
On OpenSUSE we seem to get an Enter event after or while the QWindow is
closed, and that appears to reset the currentMouseWindow after we
cleared it in QWindowPrivate::destroy. Apply a workaround similar to the
focus_window to make sure that currentMouseWindow and
currentMousePressWindow don't point to destroyed objects.

Pick-to: 6.2
Change-Id: I61afdaa7d8d1d437058624012319460be2f2567f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-06 14:23:17 +00:00
Volker Hilsheimer
197fcdd7ee Doc: mark documentation of internal functions as such to silence qdoc
Pick-to: 6.2
Change-Id: I9523511b9adf40d1280fbf320c24a79aa2860ef2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2021-09-06 16:23:16 +02:00
Edward Welbourne
c801e35282 Remove redundant break;s following return;s
Pointed out by the INTEGRITY compiler.

Change-Id: Id5f9b994c348308c56c3a25200419be525b9c933
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-09-06 15:56:28 +02:00
Craig Scott
f68f6ecf6f Fix cases of output variables not being passed back to calling scope
Some versionless wrappers were not passing back output variables to
their calling scope. Ensure they always are.

Fix qt6_extract_metatypes() to set its output variable in the parent
scope (it was previously setting it erroneously in the local scope).

Some functions had code paths that would not set output variables.
This would allow situations where if the variables had an initial
value set by a higher up parent scope, the output variable would
still have that value in the caller's scope upon return. That could be
misleading, so fix these code paths to explicitly set the output
variable to an empty string instead.

Task-number: QTBUG-96121
Task-number: QTBUG-96219
Pick-to: 6.2
Change-Id: I291775813f025cabdccd4372ac077cdfd3ec090e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-09-06 23:56:28 +10:00
Craig Scott
a37789e493 Revert "Ensure versionless wrappers do not introduce a new variable scope"
This reverts commit 08180e76e6.

Macros add another level of escaping that functions do not. The
conversion of the versionless wrappers to macros may alter the
behavior, so revert that change.

Task-number: QTBUG-96219
Pick-to: 6.2
Change-Id: Ic5dcff3081123d957888584ba1d76ae0580d9083
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-09-06 23:56:28 +10:00
Tor Arne Vestbø
9877d55a50 macOS: Report preedit cursor position and cursor visibility correctly
Unfortunately QInputMethodEvent::Cursor defines length == 0 as the
cursor being hidden, and length > 0 as being visible. This is the
opposite of what native macOS application do.

A future improvement here would be to base the QInputMethodEvent
logic on QStyle::SH_BlinkCursorWhenTextSelected, which we already
respect for normal selections. That would also allow us to use
QInputMethodEvent::Cursor to set the preedit selection, which
we currently have to fake via QInputMethodEvent::TextFormat.

Pick-to: 6.2
Change-Id: I75b5d8c5403283a0988355e440a98b4df35ec995
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-09-06 14:37:43 +02:00
chenbin
0624eba1b1 Partially modified to use C++11 standard nullptr
Change-Id: I0542c47d1979235206005bf603822b6ea415f2da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-09-06 09:49:46 +08:00
Volker Hilsheimer
ef8ca68406 Doc: fix qdoc warning, add \inmodule for qdrawutil header
Change-Id: Iddc0273778adf79250b4e767172b1202817507bb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-05 23:07:52 +02:00
Volker Hilsheimer
c111b6b7b1 Doc: fix qdoc warning, function prototype missed return type
Also missed the second set of template parameters.

Change-Id: I81ab09ed77af79415ee72334db900bdb94db5739
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-05 21:07:48 +00:00
Volker Hilsheimer
5f3df6e1c7 Doc: fix qdoc warning from wrong see-also
Only QByteArray has a toHex() member, QByteArrayView doesn't.
Since toHex() is linked to from result() already, remove it here
to avoid the wrong impression that there was a toHex() that doesn't
require any memory allocation.

Change-Id: I76f876aca90403baebf9328b794aeaf9be698c46
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-05 23:07:44 +02:00
Tor Arne Vestbø
2262744ad0 QMessageBox: Reset clickedButton for each invocation of the dialog
When showing a messagebox that has already been show we don't want to
keep around the clicked button of the previous invocation.

Pick-to: 6.2
Change-Id: Ib6f6293d40ab338c550ea344094db871ccf45c46
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-04 23:09:30 +02:00
Shawn Rutledge
673ed80fa4 doc: Add the PixelScroll device capability (new in 6.2)
Followup to 69c833dae9

Pick-to: 6.2
Task-number: QTBUG-72167
Task-number: QTBUG-87646
Change-Id: I4ac7cbacd6dc1407ad3b565674a6d6494ec8857f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-04 11:55:27 +02:00
Timur Pocheptsov
c55f61578c QSslCertificate(OpenSSL plugin): fix memory leaks in extension 'parser'
They went unnoticed previously because of lazy evaluation, which is
not the case anymore.

Fixes: QTBUG-96155
Pick-to: 6.2 5.15
Change-Id: I46026a24b354c1db7c10d84fceae06c4ab7cc0fc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-04 08:25:18 +02:00
Sze Howe Koh
ee5077daf5 QPixmap: Fix crash if created without gui app in secondary thread
The thread checking in in_pixmap_thread_test() is only safe, and only
makes sense, if we have a QGuiApplication. If we only have
QCoreApplication, only null QPixmaps may be created anyway, so
threading makes no difference.

Fixes: QTBUG-95358
Pick-to: 6.2
Change-Id: I93c983a3d6c271b0a19dfd0384862fc151459029
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2021-09-04 03:43:44 +02:00
Tor Arne Vestbø
ae8e96d4c2 macOS: Don't rely on invalidateCursorRectsForView when mouse is over view
Calling invalidateCursorRectsForView will normally result in a updateCursor
callback, where we then set the current cursor using [NSCursor set]. But
if an override cursor is set by AppKit, which happens for example when
hovering over a resizable window's theme frame, then AppKit ignores the
call to invalidateCursorRectsForView. And it will not consult the view
when the override cursor is unset again, which results in the cursor
being reset back to the default arrow cursor instead of the cursor
that was set when we initiated the invalidateCursorRectsForView call.

We need to hit-test to confirm that the mouse is over the view,
as there might be child views in the mix that also have custom
cursors, and we don't want to activate the parent view's cursor
unless we're actually over that view.

Fixes: QTBUG-81552
Fixes: QTBUG-96003
Pick-to: 6.2 5.15
Change-Id: I52573ab7be82f28c6a1cf686bd4b133551cfe98b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-03 22:38:07 +02:00
Volker Hilsheimer
f70421bfc0 Doc: add more notes about full screen windows on macOS
Fixes: QTBUG-68069
Pick-to: 6.2 5.15
Change-Id: I8fc99f708cfa19a9c8cc8d13f6889549c79dd3b3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-03 21:40:08 +02:00
Volker Hilsheimer
1ebea13765 Doc: fix qdoc warnings from wrong parameter type
QWidget::addAction takes a QKeySequence, not a QShortcut.

Change-Id: Ia10adcf50133b306d484a122ed17dddcf94372a6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-03 21:40:08 +02:00
Volker Hilsheimer
62fc486a77 Doc: fix a bunch of qdoc warnings from wrong prototypes
* name method parameters consistently with their declaration
* don't document parameters that are not there

Pick-to: 6.2
Change-Id: I06ae9fdca357ed29eb7a72802f149eb4914181f4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-03 21:40:08 +02:00
Volker Hilsheimer
2c6de9c099 Doc: add note that hiding a window doesn't close a full screen space
Fixes: QTBUG-52450
Pick-to: 6.2 5.15
Change-Id: I3f819bac470b5a883a74fb58f6fa2d27740eaaf2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-03 21:35:06 +02:00
Joerg Bornemann
4c52dd43ae Fix QMAKE_LIBS_OPENSSL/NOLINK entries in qt_lib_network_private.pri
The file qt_lib_network_private.pri contained the following bit
  QMAKE_LIBS_OPENSSL/NOLINK =
  QMAKE_INCDIR_OPENSSL/NOLINK = C:/openssl/include
  QMAKE_LIBS_OPENSSL =
  QMAKE_LIBS_OPENSSL_DEBUG = -L"C:/openssl/lib/VC" -llibssl64MDd
  QMAKE_LIBS_OPENSSL_RELEASE = -L"C:/openssl/lib/VC" -llibssl64MD
  QMAKE_INCDIR_OPENSSL = C:/openssl/include

The /NOLINK entries are nonsense.  QMake projects that do
  QMAKE_USE += openssl/nolink
would use QMAKE_INCDIR_OPENSSL and discard the QMAKE_LIBS_OPENSSL*
variables.

The QMAKE_*_OPENSSL/NOLINK entries stem from the WrapOpenSSLHeaders
CMake package, and QMAKE_*_OPENSSL from WrapOpenSSL.  It's safe to
assume that both packages use the same include paths.

Remove the QMAKE_LIB parameter from the
qt_find_package(WrapOpenSSLHeaders) call to avoid writing this library
into the .pri file.

Pick-to: 6.2
Fixes: QTBUG-89562
Change-Id: Ibc20f6f90678eb127db7813eb63c5c3e0bff2268
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-09-03 21:35:06 +02:00
Shawn Rutledge
4d8fb1bc6f cocoa: use TouchPad deviceType for trackpad
WheelHandler { acceptedDevices: PointerDevice.TouchPad }
doesn't react unless we use the right type.

Amends 69c833dae9

Pick-to: 6.2
Change-Id: I813de096b87f3af4dfcf5510abc0d0bd9c15b689
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-03 19:53:32 +02:00
Laszlo Agocs
6906516004 rhi: Add a way to tell an srb that only the resources have changed
Until now, after updating the bindings one had to always rebuild the
srb, which can be heavy esp. on Vulkan (release old objects, create
new layout object, descriptor sets). When updating the binding list in
a way that it is fully isLayoutCompatible() == true with the previous
list, this is an overkill. Internally, most notably in
setShaderResources(), we already should have everything in place in
all backends to recognize if the entries in the binding list refer to
QRhiBuffer/Texture/Sampler objects that are different than before, and
so apart from adding an alternative to create() in the API there is
not much else needed here.

Pick-to: 6.2
Change-Id: I2efdd4fd0b24c7ebba694a975ed83509744b044b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-09-03 17:14:59 +02:00
Kai Köhne
c104af4c44 Doc: Remove unsupported customFilters
customFilters defined in .qdocconf are not supported anymore by Qt
Assistant since Qt 5.13. Therefore remove them from all .qdocconf files,
also to avoid cargo-culting them to new help modules.

Task-number: QTBUG-95987
Change-Id: I664391460637d2e859348da0338e1a4a3ee9f570
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-03 15:14:59 +00:00
Laszlo Agocs
65cad49473 rhi: Correct a doc note
It is not true that isLayoutCompatible() can be called before create().
That used to be the case before the optimizations have been added.
The docs are still internal, but let's fix it up.

Pick-to: 6.2
Change-Id: Iee61848f058a06774550af6f38a3253956e4cfd3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-09-03 17:14:59 +02:00
Laszlo Agocs
6cdf95a970 rhi: Include resource count in srb layout compatibility checks
Relevant for Vulkan, given that descriptorCount is part of
VkDescriptorSetLayoutBinding, meaning two srbs with arrays of
SampledTextures should only be reported as compatible if the
array size matches.

Also reduces the prealloc size for the VLAs. For Qt Quick even a
lower number would be sufficient, but we still keep the number
something fairly high in order to play nice with Quick3D.

Pick-to: 6.2
Change-Id: Id92b7c09b051ebe54b1fa2bf4ba78950fe60ba27
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-09-03 17:14:59 +02:00
Ievgenii Meshcheriakov
19a48b8545 unicode: Regenerate qunicodetables{.cpp,_p.h}
Run unicode utility to regenerate the Unicode tables. This reduces
size of the IDNA mapping tables. Adjust the QUrl client code to use
the new API.

Task-number: QTBUG-85323
Change-Id: Iaa8d6932e611f7aa4009a3fae2972de87b875cf8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-03 14:43:16 +02:00
Alex Trotsenko
340131b4be QWindowsPipeWriter: suppress a warning on unexpected peer disconnection
The other side can close the pipe at any time independently of us, so
ignore the ERROR_PIPE_NOT_CONNECTED error code if the write operation
failed.

Change-Id: I4f7ccd73c19ca2dd24fa1c9f33b5f60541a7521d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-09-03 09:31:42 +03:00
Volker Hilsheimer
7ba75d088c QWidget: close the QWindow in QWidget::close
We want to close the window, end full screen mode on macOS, and free
platform resources. This is all done by QWindow::close. QWindow::close
closes the platform window, triggering a closeEvent to QWidgetWindow,
which then calls QWidgetPrivate::close_helper.

This way, closing a window via QWidget::close, QWindow::close, or
interactively by the user are all equivalent.

The QCloseEvent generated by the widget needs to be spontaneous for
window-system generated events (i.e. the user clicked the close button),
and non-spontaneous if the window closes because of a call to
QWindow::close. To keep track of whether the event originated in an
explicit call to QWindow::close, add a boolean to the QWindowPrivate.

Add a test case that verifies that the window resources is destroyed,
and that events are delivered as they should.

Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Fixes: QTBUG-46701
Pick-to: 6.2
Change-Id: Iacb6a2c8d5e880b16b0c8f0c9257ed94bed36f5b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-02 20:34:48 +02:00
Mårten Nordheim
05c9894330 QNetworkAccessCache: Style fixes and move asserts
Change-Id: I300d2525d9987737697e2cc6a326be19554902c8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-02 16:57:42 +02:00
Mårten Nordheim
a253bec500 QNetworkAccessCache: Port to QDeadlineTimer
QDeadlineTimer is semantically more correct than comparing timestamps to
'now'.

Change-Id: I15d9654af2886499392e6409d22f802203aca18d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-02 16:57:42 +02:00
Mårten Nordheim
3a7d6767e9 QNetworkAccessCache: move debug logging to specific ifdef
Instead of for any debug output.
Since QTestLib cuts off output after X messages we shouldn't add these
by default.

Another option would be categorized logging, but QNAC should not be very
interesting for 'outside' users

Change-Id: I4c2c2a68ca4962476bfecd679f3229ccf3403aee
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-02 16:57:42 +02:00
Mårten Nordheim
8460a55d32 QNetworkAccessCache: Remove the ctor and init member variables in class
Change-Id: Ic7ce41679d89b496413ef13e6e917bf506b2405d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-02 16:57:42 +02:00
Mårten Nordheim
3a8f9286fc QNetworkAccessCache: Rename first and last node
'oldest' and 'newest' to me make me thing of 'least recently inserted'
and 'most recently inserted', which is what they used to mean.
But now the expiration can be set per-request so the semantics don't
work anymore.
So, rename to 'nextExpiringNode' and 'lastExpiringNode'. Also rename the
node member elements "older" and "newer" to the more generic "previous"
and "next".

Change-Id: I582267d09c60c68396e4201e4a20185bbf0942e2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-02 16:57:42 +02:00
Edward Welbourne
7403561f21 Remove a redundant check
Missed in a recent fix to QTimeZonePrivate::dataForLocalTime(), but
noticed during picking back to 5.12

Pick-to: 6.2
Change-Id: I63964952150fedf857b7aef12dfc866097d2e2d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-09-02 16:35:12 +02:00
Edward Welbourne
f645bb8880 Replace implementation-specific zero test with plain comparison
Various double-to-string converters carefully omit the sign from -0.0,
for which they need to test whether the double is zero. This was
tested by a function that looked at the bytes of the double in an
endian-specific way. Packaging a comparison to zero in a function
seems to avoid the compiler warnings over double-comparison, so retain
the function but make it simpler. The only available benchmark
(QString's number_double benchmark) consistently shows a negligible
improvement in performance.

Change-Id: Id994177e21e4770ced904881d7e84a95cb727605
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-09-02 16:35:12 +02:00
Craig Scott
f266381b1b Clean up output target handling left behind by earlier changes
Previous work removed the no-longer-used code path that could add
targets from qml compiler features. The variable that code path would
populate was not fully cleaned up in that removal. Clean it up now and
move the variables related to output target handling closer to the
only remaining area where they could be generated.

Also ensure that we set the variable named by OUTPUT_TARGETS even if
isBinary ends up being true. We should explicitly set that variable
to an empty string in that case.

Amends 363df5cd70

Pick-to: 6.2
Change-Id: I17de9788b390aac9a7aedb29ab9bdfee99c305af
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-09-02 20:52:22 +10:00
Fabrice Fontaine
035dc537be Fix build on riscv32
riscv32 fails to build because __NR_futex is not defined on this
architecture:

In file included from thread/qmutex_linux.cpp:45,
                 from thread/qmutex.cpp:804:
thread/qfutex_p.h: In function 'int QtLinuxFutex::_q_futex(int*, int, int, quintptr, int*, int)':
thread/qfutex_p.h:116:30: error: '__NR_futex' was not declared in this scope; did you mean '_q_futex'?
  116 |         int result = syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3);
      |                              ^~~~~~~~~~
      |                              _q_futex

Pick-to: 6.1 6.2
Fixes: QTBUG-96067
Change-Id: Ib6a9bcc496f37e69ac39362cb0a021fccaf311f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-09-02 09:59:33 +00:00
Alex Trotsenko
5d68858ba7 QLocalSocket/Win: fix waitFor...() functions for write-only socket
There were several issues with the socket state checking when the pipe
reader is not running:

  - the number of object handles in the WaitForMultipleObjectsEx()
    call might have been zero;
  - a call to the waitForDisconnected(-1) might have hung;
  - we did not perform a loop iteration for the waitFor...(0) calls,
    so disconnect detection was unreliable.

These issues are related to the same code, so they don't seem to be
addressable separately.

Change-Id: I3bca872bb4191e6a7d38a693d81f7981af7fe145
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-09-02 08:47:11 +03:00
Liang Qi
9a4c98e556 xcb: support xrandr(1.5) monitor setup
More information about monitor in xrandr 1.5, see
https://keithp.com/blogs/MST-monitors/

Since this change, screen is logical instead of physical.

If xrandr 1.5 and later is installed, Qt screen info will get
from xrandr monitor object instead of xrandr output if only have
1.2 to 1.4.

Users can manipulate monitor as they want, for example, a
combination for two physical screens, half of one screen and etc.

Didn't have chance to access MST monitors, but it should work
if xrandr monitor object was created automatically.

[ChangeLog][xcb] Qt screen info will get from xrandr monitor
object if 1.5 is installed.

Fixes: QTBUG-65457
Change-Id: Iad339cc0d4293b2403b4ef6bf6eb770feb3e685f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-01 20:32:04 +02:00
Thiago Macieira
f3743073a7 qstrnlen: micro-optimize further
This is the kind of loop that the autovectorizer is pretty good
at, but this is really just a type of memchr, so help dumber
compilers and build modes without vectorization.

Drive-up fix the style of the test code.

Change-Id: Ie72b0dd0fbe84d2caae0fffd16a022a35fa24c17
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-01 11:32:03 -07:00
ChunLin Wang
ca69e5aeef Fix QListView assert when the last row is moved in IconMode
After the last row is moved, 0 will be returned when obtaining
row and column data. At this time, QListView::doitemslayout will
not call d->doitemslayout, so the QBspTree data structure will
not be cleaned up, leaving a stale tree structure behind. This
will trigger an assert during paintEvent handling if QListView is
set to IconMode

In QListView::ListMode the test for a valid model index doesn't
use an assert.

Call QListViewPrivate::clear explicitly if the column count is 0
so that the QBspTree and other data structures are cleared.

Add a test case that simulates this scenario by implementing a
model that returns a 0 column count for an index after the model
structure was changed through a move of rows.

Done-with: Volker Hilsheimer
Fixes: QTBUG-95463
Pick-to: 5.15 6.1 6.2
Change-Id: I36419be5459b8ced930c619f538482ea1db4ad03
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-09-01 16:03:15 +00:00
Edward Welbourne
38ec2c830b qlocale_win: Fix non-standalone month names
We have previously been using the standalong (nominative) month names
both when asked for that and when asked for the plain (genitive) month
name, probably because there was no LCTYPE value for the
latter. However, MS's docs for the standalone values do contain a
comment telling us how to get the genitive names.

Rename the old monthName() to standaloneMonthName() and add a
monthName() that calls GetDateFormat() suitably, as described by the
MS doc.

Pick-to: 6.2 5.15
Fixes: QTBUG-92018
Fixes: QTBUG-86279
Change-Id: I27f63198c3a15b792683f476d2019078b0860f99
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-09-01 17:56:46 +02:00
Edward Welbourne
6da648ad83 Add a QLocale(QStringView) constructor
Only a few more internals just needed to change to take QStringView,
to connect up the constructor with internals already long since
converted.

[ChangeLog][QtCore][QLocale] Added QLocale(QStringView) constructor.

Change-Id: Iec31391e6168f333b4b6fc633c3d7d01872f83b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-09-01 17:11:44 +02:00
Eirik Aavitsland
dc65267ad8 When clearing QPixmapCache, stop its flushing timer
No need for timer event to reduce cache size when it is already empty.

May also avoid the "Timers cannot be stopped from another thread"
warning at exit, if the global cache object is then deleted by another
thread.

Fixes: QTBUG-96101
Pick-to: 6.2 5.15
Change-Id: Id1aeecfbb43a25a887ebd5cc7242749a74290bb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-09-01 17:11:44 +02:00
Eirik Aavitsland
a6a3b1e79c Update bundled libjpeg-turbo to version 2.1.1
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.1

Pick-to: 6.2 5.15 5.12
Change-Id: I22a273018229aa35a175f9e903fa605a3eb55c32
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-09-01 17:11:43 +02:00
Ivan Solovev
313de93b1d QDoubleValidator: fix NaN check in validateWithLocale
We can't really compare two NaN's. Should use qIsNaN() for that.

Pick-to: 6.2
Change-Id: Ia514cabe65cfcdeafb39cab91ecdb66f8fae725c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-01 17:11:43 +02:00
Mårten Nordheim
81a9335c65 Fix documentation of QNetworkAccessBackend
The classes themselves were not documented, so...:

Add some documentation for QNetworkAccessBackendFactory.
Add some overall class docs for QNetworkAccessBackend.

The class docs were marked \internal (because they mostly are).
I don't think we yet have a defined way to handle semi-private APIs but
having them be marked \internal and leaving the documentation in source
seems fine (and was what someone suggested a while back).

Add documentation for pure virtual functions which were overlooked.

Pick-to: 6.2
Fixes: QTBUG-88774
Change-Id: Id7fe18ec92372abb96540cd29543608f87ec862e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-01 14:51:29 +00:00
Morten Sørvig
81a7344e1d Port to QImage and QPixmap deviceIndependentSize()
Replace the “size() / devicePixelRatio()” pattern with
a call to deviceIndependentSize().

Change-Id: I9d9359e80b9e6643e7395028cd43e3261d449ae7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-01 15:24:05 +02:00
Edward Welbourne
f98d9aa9da Refine QLocale constructor documentation
Fix a typo and swap two sentences to give a clearer reading.

Pick-to: 6.2
Change-Id: I4a24ad5ba2e022edd121eb686de3638af2c242a6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-01 11:27:42 +02:00