Commit Graph

41655 Commits

Author SHA1 Message Date
Edward Welbourne
653c1aab18 Fix handling of trailing space at the end of an ISO date-time
If milliseconds were followed by a space, the space was included in
the count of "digits" read as the fractional part; since we read (up
to) four digits (so that we round correctly if extras are given), a
harmless apce could cause scaling down by too large a power of ten.

Since QString::toInt() ignores leading space, we were also allowing
interior space at the start of the milliseconds, which we should not,
so catch that at the same time.  Added tests, including one for the
rounding that's the reason for reading the extra digit, when present.

Fixes: QTBUG-80445
Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-06 14:46:48 +01:00
Edward Welbourne
187f442823 QTimeZonePrivate: remove some Q_LIKELY markers
Although the relevant conditions are indeed likely, we don't want to
push the less likely branch into hard-to-load pages; they're not
anomalous conditions, merely ones with lower probability.

Change-Id: Icc12a921d38d8c398cd832964e9d57d7648698b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-06 14:46:30 +01:00
Edward Welbourne
49063c34d6 Fix crash when a date-time has an invalid time-zone
QDateTime is a friend of QTimeZone, so can access its internals; but
it must check the zone is valid before doing so.

Expanded tst_QDateTime::invalid() and made it data-driven to catch the
failure cases.

Commented on a test-case that caught a mistake in my first attempt at
this, and on QDateTimeParser's surprising reliance on a quirk of
QDateTime::toMSecsSinceEpoch()'s behavior.

Fixes: QTBUG-80146
Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-12-06 14:44:18 +01:00
Volker Hilsheimer
da94625f38 Fix sizeHint of QProgressDialog to have enough space for window margins
Some styles, notably QMacStyle, use different margins for widgets and
for windows. For these margins to be returned correctly, we have to
tell the style that we want them for a toplevel widget. This was
done correctly when laying out the dialog, but not when calculating the
sizeHint, leading to a default size of the dialog that was too small
to fit the text.

As a drive-by, change variable names in the sizeHint method to be a
bit more readable.

Change-Id: Ib4168c7be176fa816241ebcc5f9235db4a7f982f
Fixes: QTBUG-80272
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 13bbb1d9b9411e6eb65848efa8c0d481109b8868)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-12-06 12:14:19 +01:00
Leena Miettinen
5da34ac263 Doc: Update info about building tests
Task-number: QTBUG-63987
Change-Id: I4b6e8f35afc9d3ca10b393a0305bbb51bf81ec26
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-12-06 09:00:28 +01:00
Eirik Aavitsland
20266820a3 Item views: do not clip items horizontally in dragging icon
The dragging icon is created from the visible items in the
selection. It would be clipped to the parts visible in the
viewport. That meant that items on the edge could be rendered
illegible, even though they were part of what was being dragged.

Fix by dropping the horizontal clipping to the viewport. Items fully
outside the viewport are already filtered away, so this should at most
make a difference to the bottom and/or top items in the set.

Keep the vertical clipping, since items may easily be very wide, so an
unclipped icon would be unwieldy.

Done-With: Sona Kurazyan <sona.kurazyan@qt.io>
Fixes: QTBUG-77336
Change-Id: I2d29cb0ca69c1058635106aa0c67e9f7e140d1cd
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-12-06 08:25:17 +01:00
Friedemann Kleint
843be88e29 Manual High DPI test: Add a page logging all screen change signals to Metrics
Turn the Metrics widget into a QTabWidget and add a tab logging
all changed signals of QScreen.
This is useful when for example debugging issues with lock screens and
laptop hibernation.

Task-number: QTBUG-79248
Task-number: QTBUG-76902
Change-Id: Ie86789fe1514cb3333a5f3def7f613f217fa6802
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-05 18:37:00 +01:00
Sona Kurazyan
81459dd9c0 Copy formatting attributes when cloning an empty QTextDocument
When cloning a QTextDocument, the text fragment of the original document
is copied into the new one, which results into copying also the
formatting attributes. However, when the text document is empty, the
corresponding text fragment is also empty, so nothing is copied.

If we want to transfer the formatting attributes for an empty document,
we need to set them explicitly.

Fixes: QTBUG-80399
Change-Id: I382cd0821723436120af47c06ec7bfa849636307
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-05 17:34:02 +01:00
Thiago Macieira
1f592da7f1 QCborValue: fix replacing of elements with byte data with ones without
We forgot to reset the flags when replacing the element, so we ended up
with an integer with HasByteData after:

    testMap[0] = QStringLiteral("value");
    testMap[0] = 42;

Fixes: QTBUG-80342
Change-Id: Ia2aa807ffa8a4c798425fffd15dabfa066ea84b0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-12-05 07:59:07 -08:00
Friedemann Kleint
455e9e5be3 Windows QPA: Fix tray geometry not updating
The application does not update its screens when there are
no windows on which a WM_DPICHANGE could be received. Add a
check for it to the tray window procedure and trigger an
update from there if no top levels are present.

Fixes: QTBUG-79248
Change-Id: I0b1c4db560662ecf2b473304942da373be6fdc73
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-12-05 15:49:32 +01:00
Dimitrios Apostolou
75f75e997a docker-compose now brings up the docker images tagged as "latest"
This is so that we can do simple changes to the docker images
in provisioning, without needing to update the tag here.

If a backwards-incompatible change in the docker images needs to be committed
in provisioning and here, it is possible because the images retain their old
unique SHA1 tag, in addition to being tagged as latest. See comment for more
details.

Requires the change in qt5 repository, with commit sha:
e4f9ac5607a329bae045567a339d36469bc4fff6

Task-number: QTBUG-79867
Change-Id: I1bc72edec62487530575d7e113a25afe16d09129
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-12-05 15:40:00 +01:00
Tor Arne Vestbø
aabf4fbbe9 macOS: Improve QCocoaGLContext logging
Change-Id: I27d0abe0eb5b0f0ba64b8787b430484c48b131c0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-05 14:28:34 +01:00
Tor Arne Vestbø
35da2b87e3 macOS: Enable fullscreen for windows by default
This matches the default collection behavior of NSWindows.

Change-Id: I363ed211daf6c6c2e579eb11c7294ff509d53e91
Fixes: QTBUG-63829
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-05 14:28:22 +01:00
Allan Sandfeld Jensen
c7fec68e19 Do not read Xft.dpi on platforms that shouldn't be using Xft settings
We only read this for desktop environments that have traditionally used
these to set settings for other toolkits.

Fixes: QTBUG-80323
Change-Id: Ifa8c2682301e69c2770d3734115080a0e6b4e85c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-12-05 14:08:09 +01:00
David Faure
aa504fc2fa Optimize qLastIndexOf<QString> to not detach the QString
The call to data() on a non-const QString led to a detach(), which is
unexpected and unwanted from QString::lastIndexOf() const.

Found by looking at why QFileSystemEntry::fileName() was expensive, in
the hotspot profiler.

The solution is to instanciate QLastIndexOf with QStringView() rather
than QString(). I added a deleted QString overload to make sure nobody
ever instanciates it with a QString argument again.

Change-Id: I06a1b2f937425e83f0779eb215e099aef78c50a7
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-05 14:06:02 +01:00
Christian Ehrlicher
97ac281c1d QStyleSheetStyle: properly honor checkmark size when drawing a QMenu
When drawing a QMenu which is checkable but does not have an icon
somewhere, the width of the (possible) checkmark was not considered
during drawing and the text was drawn over the checkmark. Also the wrong
state was checked for drawing the checked icon (if one was given).

Fixes: QTBUG-80506
Task-number: QTBUG-78238
Change-Id: Icf8aa37aab424564054d3549defee93eb0d7c1a4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-05 13:56:09 +01:00
Christian Ehrlicher
925b33bdaa QPlainTextEdit: update internal palette on QEvent::EnabledChange
QEvent::EnabledChange did not update the palette of the internal
QPlainTextEditControl which lead to a wrong text color when the
QPlainTextEdit was disabled e.g. due to a QGroupBox.
Fix it the same way it is done in QTextEdit - set the new palette also
to the internal control when QEvent::EnabledChange is received.

Fixes: QTBUG-80150
Change-Id: Icbeddf3d6cd4877a3d8d4a06b2da69383dd776d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-05 13:56:03 +01:00
Alessandro Portale
83df5c71e6 Fix qmake's sed functionality for input containing CR+LF newlines
QTextStream, reading a file with CR+LF newlines from an stdio FILE
handle that was opened without "b", will always return false in atEnd().

Changing the open mode from "r" to "rb" works around the issue.

Task-number: QTBUG-80443
Change-Id: Ib2eafc0c4c6a6d2bcaeea3036474549d2d9e1511
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-12-05 13:34:18 +01:00
Jan Niklas Hasse
92cf38018a Quit application when QWindowsSystemTrayIcon receives WM_CLOSE
When an application only has a trayicon and is killed by `taskkill /IM
binary.exe` the trayicon's HWND will receive a WM_CLOSE message. If we
don't handle this, the tray icon will close anyway, but the app still
runs in the task manager.

Fixes: QTBUG-43855
Change-Id: I5f82a068df9c40360bd565a2681e1b37ff114e44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-12-05 08:57:43 +01:00
Dimitrios Apostolou
7cf8c993c7 Fix flaky test tst_QFiledialog::clearLineEdit()
Task-number: QTBUG-76989
Change-Id: I3ec7f65500476346e1a8f1017c6452517a660860
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-12-03 19:57:03 +01:00
Edward Welbourne
dc7fa56948 QMacTimeZonePrivate: use .member rather than [- member] notation
Apparently this is our preferred style for Objective C member references.

Change-Id: I8b2bbaabadbea2cfa74f209372e77cee79e3c895
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-12-03 19:00:22 +01:00
Edward Welbourne
deb166a5ff Make QMacTimeZonePrivate default constructor more efficient
Inline systemTimeZoneId() in it to save the need for init().
We thus save the lookup by name for a time-zone object, when that
object is what we took the name from anyway.

Do some minor tidy-up in the other constructors and add an assert to
systemTimeZoneId() to match the new one in the default constructor.

Change-Id: Ib70acf31bdb4a4fa1306eebd1fd5f00ad6b89bcc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-03 18:59:58 +01:00
David Faure
9f79ab360f Fix assert in QTextDocument CSS parser on "border-width: 1pt"
The code was assuming that if the parsing of the value worked,
then it must be a list of 4 variants. But in this case it's just
a single length.

This came from <td> using 4 values for border-width
while other elements use a single value. But the storage
is shared. So the fix is to use 4 values everywhere.
When reading 4 and there's only one, it gets duplicated,
so the caller can just use the first one in that case.

Task-number: QTBUG-80496
Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-03 17:54:24 +01:00
Volker Hilsheimer
e4d1a03df0 QMacStyle: correct placement of edit field in combobox
The dark edit field is now centered within the frame around it, with a
thin border on all sides, including between input field and button.

Change-Id: I27e853289e9048c21fdc81e45fadacba9665b49e
Fixes: QTBUG-63454
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-03 17:06:39 +01:00
Morten Johan Sørvig
4d796cbf17 Prevent emscripten_webgl_destroy_context from removing event handlers
The JavaScript implementation of that function has
the following code:

  if (typeof JSEvents === 'object')
    JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); // Release all
    // JS event handlers on the DOM element that the GL context is associated with since the context
    // is now deleted.

This breaks mouse/keyboard events, etc.

Disable this logic by temporarily setting the JSEvents object
to undefined, for the duration of the emscripten_webgl_destroy_context
call.

Fixes: QTBUG-74850
Change-Id: Ied3177b0ca6e63e8ea07143bf7d6a850b0bce35a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-12-03 14:54:15 +00:00
Laszlo Agocs
c625d92385 Fix depth in renderText()
Fixes: QTBUG-31156
Change-Id: I3cbb3f9c5dfbcb182dbe283b0bf0f05a031970a5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-12-03 13:51:28 +01:00
Edward Welbourne
580fd2dbd3 Relocate a comment that had become detached from its code
Two little tool functions had come between it and the function it
actually describes.

Change-Id: Ib49d1623833275ea79c7916fece29aed9503aa40
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-12-03 12:28:37 +01:00
Joni Poikelin
8310d636be Fix serializing QUuid with QDataStream with Qt 4 stream versions
Fixes: QTBUG-76103
Change-Id: Iac92c33539940f5f67d014db5240c6dc14bfb772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-12-03 13:28:22 +02:00
Laszlo Agocs
443ef0010a rhi: Remove unused compat functions
These were kept around to keep Qt Quick compiling, but the
migration there has been done a long time ago. Remove these
leftovers now.

Change-Id: Ibd47381b410b11b5475a85c7ed3cb05c22f7adbb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-12-03 12:15:26 +01:00
Tor Arne Vestbø
9ac156c90b iOS: Guard against request for textInputView without focus window
Change-Id: I7b8df07fffef1cc948f6720685234540a20ccc81
Fixes: QTBUG-79316
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-03 01:14:58 +01:00
Tor Arne Vestbø
438702ac5f macOS: Don't tweak NSApp presentationOptions on startup
AppKit will initialize NSScreens nowadays, so we don't need to manually
trigger it.

Task-number: QTBUG-80193
Change-Id: Ic0251a1b978b9d4ff53f20e67902787cf529fa87
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-12-03 01:14:50 +01:00
Friedemann Kleint
b63141fb14 RHI/Vulkan: Fix build
Add missing include, fixing:
rhi\qrhivulkan.cpp(6273): error C2027: use of undefined type 'QWindow'

Amends 0f812db558.

Change-Id: Ide61b713e958877f18a45a89b36a4e1330f75821
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-02 11:30:51 +01:00
Laszlo Agocs
0f812db558 rhi: vulkan: Remove unused include
QVulkanWindow support has long been removed from the Vulkan backend.
The include is a leftover from those times.

Change-Id: Ie68ac3611b24310f2b6111a72dd0679adafdc74d
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-11-29 12:23:57 +01:00
Peter Varga
cc5c47d85f macOS Accessibility: Fix role for comboboxes
Otherwise combobox with editable text field won't work.

Change-Id: I135c3a63cf8fba66d724e140a5a63828853e154e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-11-29 08:22:00 +01:00
Andy Shaw
985f491024 QTreeView: Reset the pressed index if the decoration was pressed on
We need to reset the pressed index when the decoration was pressed on
otherwise if the mouse ends up over an already selected item that was
previously clicked on. This prevents it from thinking that the mouse
has been released on this item right after pressing on it.

Fixes: QTBUG-59067
Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-11-29 06:53:10 +00:00
Timur Pocheptsov
67bbe28d67 tst_qsslcertificate: fix subjectAndIssuerAttributes
Instead of OID as string, OpenSSL returns a human-readable name.
No need to fail then, use such a name in QVERIFY if OID not found.

Fixes: QTBUG-80329
Change-Id: I4392fc9f37367f7c34c05d172db015b44e2a8497
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-11-28 17:12:26 +01:00
Fredrik Orderud
5b1a4578f5 wasm: Disable TextureSwizzle
The WebGL 2.0 specification explicitly does not support texture swizzles. Therefore,
disabling it when targeting WASM. This fixes "WebGL: INVALID_ENUM: texParameter:
invalid parameter name" when running in Chrome or Firefox.

Change-Id: Ic7e22e0f623095245274924095cb63fd0ff7e8c2
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.19
Fixes: QTBUG-80287
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-11-28 15:21:41 +01:00
Olivier Goffart
9fd217e746 Silence intel compiler warning about float comparison
Add the equivalent intel warning macro in public header where there
was already the macro for -Wfloat-equal

Change-Id: I8f20400f0b95c8f3857fa7a0a33464c8c34d5c0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-28 14:54:59 +01:00
Friedemann Kleint
43c8596be5 More polish of the manual High DPI test
The aim is to make it suitable to test for High DPI
bugs, ideally removing the need to provide bug report
examples.

- Add descriptive window titles/output
- Add options to force scaling on/off
- Change the updating of the text to be done in screenChanged()
  and log the signal.
- Rearrange the layout and show the descriptions as labels

Task-number: QTBUG-80323
Change-Id: Ia44c184c2b38cb18045c40b440fe785c6c17925f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-28 14:26:25 +01:00
Friedemann Kleint
c94e756f01 Polish the manual High DPI test
- Use C++ constructs like range-based for, member initialization
- Fix formatting in a few places
- Silence clang warnings:
  - Add override
  - Make member variables private

Task-number: QTBUG-80323
Change-Id: I5b0fda06acb6c8054aafa4dd934b763f8493a6b3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-28 14:26:19 +01:00
Laszlo Agocs
ee3e0ed751 rhi: gl: Fix ms renderbuffer on WASM with WebGL2
Unlike renderbufferStorage, renderbufferStorageMultisample is not
guaranteed to accept the unsized GL_DEPTH_STENCIL internalformat. For the
former, WebGL 2 guarantees it for compatibility for WebGL 1, but the
multisample version does not exist in WebGL 1, so from the specs it is not
given at all that the unsized format would be accepted. So use the ES 3.0
sized format instead, like we would on a "real" ES 3.0 implementation.

Fixes: QTBUG-80296
Change-Id: I822ae382097085c0a3279c16bb69a173dbf15093
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-11-28 14:16:33 +01:00
Edward Welbourne
cfd2f3c46e Work around macOS's inconsistency in naming of India's time-zone
macOS fails to create a zone for the name its own systemTimeZone
claims to have (see new comment). So make sure we do consistently
recognize the name systemTimeZoneId() returns, using systemTimeZone
from which we got its name.

Add minimal testing of system time-zone.

Fixes: QTBUG-80173
Change-Id: I42f21efbd7c439158fee954d555414bb180e7f8f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-11-28 14:16:33 +01:00
Eskil Abrahamsen Blomfeldt
2a4dd69499 CoreText: Fix getting system fonts on recent macOS/iOS versions
We introduced a work-around for iOS 11 which breaks on more
recent OS versions because we try to request meta-fonts by
name instead of using the special system font descriptors.

This would cause warnings on the console and Times New Roman
when requesting e.g. the system fixed width font.

When testing on iOS 12 without the work-around, we are no
longer able to reproduce the original issue, so the
assumption is that this problem has been resolved. Since
iOS 11 is not a supported target for Qt 5.14 we can remove
the work-around entirely.

[ChangeLog][macOS/iOS] Fixed a bug where QFontDatabase::systemFont()
would return the wrong fonts on macOS 10.15 and iOS 13.

Fixes: QTBUG-79900
Change-Id: Ie375c8c2ab877d6d66e3696662c4939f639a6e9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-11-28 06:08:45 +00:00
Aaron Linville
d60b71d635 Fix CONFIG += cmdline testcase creating app bundle paths in Makefiles
Fix an issue where qmake on macOS will generate a Makefile with a path
to a macOS bundle instead of a bundle-less executable in the Makefile's
check rule if cmdline is specified before testcase in the CONFIG
options.

Fixes: QTBUG-80280
Change-Id: Icc9ee1355b0641981ce79526b36f29957e1afb00
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-27 22:38:02 -05:00
Timur Pocheptsov
14ae881445 QSslSocket (OpenSSL) fix a resource leak
Introduced by fe6e54fb1f. The probability -> 0,
meaning malloc must fail to trigger it, but it is still a leak. We now use
std::unique_ptr which improves the code in general a bit and fixes a leak.

Change-Id: I6c0fa36953196d3235fb60354dc9ad2396d8dfcb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-11-27 20:40:55 +00:00
Christian Ehrlicher
4422a9bd88 QWidget: don't set WA_PendingMoveEvent when geometry does not change
When the geometry of a hidden widget was set with setGeometry(),
WA_PendingMoveEvent and WA_PendingResizeEvent were set unconditionally
even if the crect already had the correct value. This lead to
unneeded Move/Resize events within sendPendingMoveAndResizeEvents().

Fixes: QTBUG-75475
Fixes: QTBUG-79906
Change-Id: Ibbe03882f039948b6b7c04887420741ed2e9c0f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-27 20:00:45 +01:00
Edward Welbourne
78cde1bfd9 Fix mis-guided init() in default QAndroidTimeZonePrivate constructor
It set the time-zone member sensibly to the default zone, but then
called init("UTC"), which over-wrote that default with UTC.  This had
no visible effect (as the default-constructed object is only used to
access methods that (though virtual) are effectively static), but was
needlessly complicated.

Tidied up systemTimeZoneId() at the same time.

Change-Id: I897aff16855c28487a1029bef50c75ebc1ff5b55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-27 18:27:43 +01:00
Edward Welbourne
c20c7efea9 Sanitize QAndroidTimeZonePrivate::init()
It was setting the system zone ID if it somehow managed to find a
match for an empty zone name; that makes no sense.

A case-insensitive comparison seems reasonable for the "this isn't
just a default zone object, used because the name I asked for isn't
recognized" check.

It set m_id after it had checked everything, where it could just as
well have used m_id as the variable in which to record whether its
check has succeeded already.

It was using the name it was asked for, rather than the one this ended
up being mapped to, which is probably a better name to use for
it. (This should only differ in case.)

Split a long line.

Change-Id: I41a3b01ba99522ee68f3d7941c532019b9ebf946
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-27 18:27:43 +01:00
Edward Welbourne
52affd322c Be consistent in the RFC2822Date invalid character tests
The ones we reject used a zero offset while the one that does parse
(though it shouldn't - revised comment) has a one hour offset. Made
them all use that offset and added a partner test that has no invalid
characters, so ensure the success of the invalid character tests isn't
due to falsely rejecting the valid date/time text to which the invalid
characters are added.

Task-number: QTBUG-80038
Change-Id: I6e3dd79b981af6803e60877229c56599cfd719cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-27 18:27:43 +01:00
Edward Welbourne
0debb205b2 Permit leading space at start of RFC 2822 Date format
Relevant RFCs explicitly permit such space.

Change-Id: I8eb444e96287368cbbf973c77513b43d1d36f972
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-27 18:27:43 +01:00