Commit Graph

41489 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
dce8849037 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4fbbf100b673ab100997dbf2f42bf195dc3c050f
2019-10-18 01:00:35 +02:00
Volker Krause
e5c003b77d Set icon on the select-all action in the text edit context menu too
Makes this consistent with the rest of the actions here, and avoids
dirty hacks like KIconTheme::assignIconsToContextMenu.

Change-Id: I749f4d5f67efdbf595a52185dd507de5f87f6487
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-10-17 16:52:38 +02:00
Frederik Gladhorn
328122dddd tst_qiconhighdpi: fix target name
CMake will complain that we have a duplicate test name otherwise.
Generally it makes a lot of sense to name the test binary the same as
the test itself.

Change-Id: I27c4b51e6a2869f025e1100f1a9dd6b54ebdaf55
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Morten Kristensen <me@mortens.dev>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-10-17 16:44:51 +02:00
Frederik Gladhorn
898ab9677e Linux print dialog: use simpler terminology for duplex
Make the dialog more user-friendly by using simple terms.

Fixes: QTBUG-79100
Change-Id: Ie4fa61cd0dc2a7fe5af9fd5834abe9d0e88c55de
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-10-17 16:44:30 +02:00
Johan Klokkhammer Helsing
4b5ff2be7c QGraphicsView tests: Prefer exposed over active
Makes the tests pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I5860c1ae6dd3d15632d827f4e357cb6c2cc9c5e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-17 13:12:17 +02:00
Johan Klokkhammer Helsing
ee4a604a2e tst_qdialog: Wait for exposed instead of active
This makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: Ib67cf8913055bbe753f71791095aff035342c18d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-17 13:12:12 +02:00
Ulf Hermann
c5e9d7e504 Generate metatypes.json for QtCore, QtGui, and QtWidgets
These libraries contain types which are exposed to QML from
qtdeclarative.

Change-Id: Ie0edaef94fcb40074b6f6b2ea1a1c3a77ed3e9a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-17 12:50:35 +02:00
Ulf Hermann
7dd14c6009 Move CBOR debug stream functions into qcborvalue.cpp
Some of them were already there, and this way they continue to function,
even if the cborstream feature is turned off.

Change-Id: I6828d2f525ab0a1437fc940a0fe786f6fa56fd6a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-17 12:50:35 +02:00
Samuel Gaist
c222a9283d QAbstractItemModel: implement QRegularExpression support for match
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

[ChangeLog][QtCore][QAbstractItemModel] The match() method now
supports the new Qt::RegularExpression match flag value. This
will allow users to use either a string or a fully configured
QRegularExpression when doing searches. In the second case,
the case sensitivity flag will be ignored if passed.

Task-number: QTBUG-72587
Change-Id: I07c8d72a661c48b7f4fcf13ef8e95980bcdcb998
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-16 21:53:30 +02:00
Ulf Hermann
85ed676dff Provide a feature for CBOR stream I/O
We need to turn it off in bootstrap code.

Change-Id: I826e49fbc5f6128e56f84b58d29358dd7b0b9dc5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-16 12:16:04 +02:00
Tor Arne Vestbø
5c37258b06 macOS: Don't dismiss menu during applicationShouldTerminate
The logic was a leftover from the Carbon days and is no longer needed.

Change-Id: I557b669eadea902fa439c43162218c5864077df9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-16 12:04:57 +02:00
Christian Ehrlicher
d5c4cd7a25 Examples: fix compiling tablet example on qnx
std::abs(int) is defined in cstdlib which is not included on QNX.

Fixes: QTBUG-78763
Change-Id: I14d087069369db7ab4e5db9d4f816a3fbffe95f6
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-16 09:18:04 +02:00
Eirik Aavitsland
ea377c5a2f Add testing of fillRect() to QPainter lancelot test
Change-Id: I3be230d3fafa178a37cf7387f79f372c8d8aeb05
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-16 06:31:59 +00:00
Christian Ehrlicher
78d349eaab tst_QSqlQuery: remove tests commented out a long time ago
Remove some code which was commented out with 'NOT_READY_YET' since the
initial Qt5 import. Since the mentioned bug reports are no longer
available remove this code.

Change-Id: I98686e53d85619f01d16105d147eba79b557a104
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-16 08:25:38 +02:00
Johan Klokkhammer Helsing
821c2eb131 tst_qfiledialog2: Don't assume window activation is available
Prefer qWaitForWindowExposed over qWaitForWindowActive whenever possible, skip
in the other cases.

Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I60b4000c72c3727a2f33b79a5038469055b0fef2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-16 07:06:12 +02:00
Johan Klokkhammer Helsing
8814c5778d tst_QAbstractScrollArea: Use qWaitForWindowExposed instead of active
Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I53011ad623e4bdb557d79c136f06ce7ac00a08ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-16 07:03:09 +02:00
Qt Forward Merge Bot
faab18c65a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
2019-10-16 01:00:49 +02:00
Ulf Hermann
06ca5c49e7 Cbor: Avoid QUrl in bootstrap code
QUrl is not available when building qmake. Hopefully we can get rid of
this mess in Qt 6.

Change-Id: Ia234996dd4f27d7f843db227e4cf2db869c92dc1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-15 20:39:32 +02:00
Johan Klokkhammer Helsing
80ddac3a0a tst_qgraphicseffect: Wait for exposed instead of active
Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I3900925e74d8d940a8c5af87ea64a6ec3c8c3293
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 20:39:32 +02:00
Sona Kurazyan
9cc040a806 Prepare for deprecating the QDesktopWidget
QDesktopWidget is marked as obsolete in docs, but it is not yet
completely deprecated, some of its methods are still in use.

Replace uses of the following methods marked as obsolete:
- QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen()
- QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry()
- QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry()

Task-number: QTBUG-76491
Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 20:09:29 +02:00
Laszlo Agocs
92b9dcfe2b rhi: gl: Do not let external rendering trash our vao
Task-number: QTBUG-79221
Change-Id: Ie8e6376f79c816071c12962dc054838aeaabcaa5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-15 20:09:29 +02:00
Tor Arne Vestbø
027d45cb57 macOS: Simplify Objective-C namespacing
We only need to use the QT_MANGLE_NAMESPACE macro when declaring the
interface of the class. As long as we couple that with an alias
declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses
of the class name can be un-namespaced, including declaring
categories on the class.

The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can
only be used once per class and translation unit, so forward
declarations get hairy, but we can avoid that by just including
the headers instead.

Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-15 20:09:28 +02:00
Friedemann Kleint
05a829f923 Win32: Consolidate registry code
Add a RAII class for registry keys and use it throughout
the code base.

Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-14 20:26:42 +02:00
Johan Klokkhammer Helsing
51f092905a QTest: fall back to qWaitForWindowExposed in qWaitForWindowActivated
...if window activation isn't supported.

Task-number: QTBUG-62188
Change-Id: Ia83de59d9a755d95b7150eb5261bc43dd7b60588
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-14 20:02:10 +02:00
Johan Klokkhammer Helsing
332c255c69 tst_qgraphicsitem: Skip tests that fail on Wayland
Task-number: QTBUG-62188
Change-Id: If0638d51bffa6ef375476c0a601c387bd05583ae
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-14 14:06:32 +02:00
Friedemann Kleint
95ac2072bb QtWidgets: Suppress QEvent::WindowActivate when minimized
Prevent call to activateWindow() for minimized windows in
QWidget::setWindowState() by clearing the flag.

Fixes: QTBUG-46763
Change-Id: I40389d0906438ffe251fc79f18a523ecb53edb1b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-10-14 10:36:43 +02:00
Sona Kurazyan
ffac899576 Fix the size calculation of QHeaderView when stylesheet is used
When calculating the header section size based on its contents when a
stylesheet is used, the size hints from the stylesheet are used. In case
if the stylesheet specifies only one of the sizes, the other is set to
-1. Because of this the actual content size is ignored.

The solution is to calculate the size based on the application style, in
case if it's not specified in the stylesheet.

Fixes: QTBUG-75615
Change-Id: I3453fa623d75b6b32832edf753de6e3e4e7f5a22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-14 10:17:07 +02:00
Lorn Potter
139246faa3 wasm: fix arch detect on windows with WASM_OBJECT_FILES
Fixes: QTBUG-79146
Change-Id: I00188013b98687f34582aeb7b29b6d7439334536
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-14 17:40:41 +10:00
Tor Arne Vestbø
b03e75670b CoreText: Preserve font descriptors when resolving fallback families
From macOS 10.15 and iOS 13 forward it's not possible to create font
descriptors for system fonts such as .AppleSystemUIFont based on the
family name.

This means we have to preserve the font descriptors we get from CoreText
for fallback fonts, so that we can populate them along with the family name.

Task-number: QTBUG-78821
Task-number: QTBUG-77467
Change-Id: Ifce01da65f90afb7dc2bc3005c3c5870b9c116de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-14 07:28:01 +00:00
Tor Arne Vestbø
253ce59c12 CoreText: Use StyleHint as fallback when family is not found
Change-Id: I11fb6cafe9d41c38eac6ca0695c89f30f998f257
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-14 09:04:29 +02:00
Johan Klokkhammer Helsing
df91ff5551 tst_qgraphicsitem: Don't assume window activation is available
Some windowing systems (i.e. Wayland) do not allow applications to steal window
focus.

Normally, we would just replace qWaitForWindowActive with
qWaitForWindowExposed, because that is usually the intent, in this test
however, there are many occurrences of both variants right after each other.
And, as described in the commit message of 153e8b49a, this may be because
window activation may cause repaints, and we want to wait for it to reduce
the chance of receiving an extra repaint later (possibly causing tests to be
racy).

Therefore, I took the conservative approach, and kept the qWaitForWindowActive
calls, except when the capability is not available. Hopefully this will not
cause flakiness in existing platforms, while also allowing tests to pass on
platforms where activation is not supported.

Task-number: QTBUG-62188
Change-Id: I15502baa28c464a808d585a5e6d67c9b745b17ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-14 08:39:31 +02:00
Lars Knoll
d0b83adfe7 Make QJsonObject::iterator a true random access iterator
Amends and fixes 7236721bf8
where the iterator category was changed from bidirectional
to random access without adding all the required functions.

Fixes: QTBUG-57353
Change-Id: I2c96448facb222c8b8f9ad4423cb0dbd1ed098f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-13 21:35:29 +02:00
Sona Kurazyan
66a9c4b0b2 Remove usages of deprecated APIs of QDesktopWidget
- Replaced the usages of the following deprecated APIs:
  * QDesktopWidget::screenCount() -> QGuiApplication::screens().size()
  * QDesktopWidget::screenGeometry(int) -> QGuiApplication::screens().at()
  * QDesktopWidget::screenNumber(QPoint) -> QGuiApplication::screenAt(QPoint)

- Added notes for the QWidget *QDesktopWidget::screen(int), which
currently has no replacement.

- Fixed the tests to build conditionally, only when these APIs are
enabled.

Task-number: QTBUG-76491
Change-Id: I2fdec96d0a6a4fc782c53549b05a5556412b8305
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-13 13:08:42 +02:00
Qt Forward Merge Bot
8d8140dffa Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
2019-10-13 01:00:43 +02:00
Giuseppe D'Angelo
e55a79b022 PNG handler: stop using volatile
I can only guess: the compression quality was declared volatile
to make it survive across a setjmp/longjmp. However, executing
a longjmp makes the code never touch the quality variable again,
so volatile isn't needed.

Change-Id: Iba1559d66200b900fbad55aa0ee3011b2407eead
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-12 10:27:49 +02:00
Joerg Bornemann
a90899df43 Default to #!/bin/bash in wrapper scripts on macOS
This gives the user the opportunity to employ BASH_ENV to circumvent
macOS System Integrity Protection and set variables like
DYLD_FRAMEWORK_PATH.

Fixes: QTBUG-57204
Change-Id: Icd99d903a3be76fabd509e204ea61a254a96609c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-12 09:57:28 +02:00
Christian Ehrlicher
b43f5ed2da QMYSQL: remove support for MySql 4.x
MySql 5.0 was released 2005 so it's time to remove support for MySql 4.x
14 years later.

[ChangeLog][QtSql][QMYSQL] Removed support for MySql < 5.0 since 5.0 was
released 14 years ago.

Change-Id: I45005accdffefbd9338ac0e710512a4c7ea8e09e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-10-12 08:31:01 +02:00
Giuseppe D'Angelo
8aa3329a71 JPEG image handler: remove undefined behavior from setjmp/longjmp
The JPEG writing code features a setjmp/longjmp pair to deal with error
handling. In doing so, it creates UB by touching local objects after the
setjmp and then after the corresponding longjmp.

The rules on what we can do are quite strict: objects that are

1) local to the function calling setjmp;
2) not qualified with volatile;
3) written into after the setjmp;

have indeterminate state after the corresponding longjmp call
(man 3 longjmp, C 2x draft N2346 §7.13.2.1.2).

Not making any assumptions on any compiler used: let's just say that
using them in any way is UB.

Luckily, no compiler exploits this (yet), and the code works just fine.
But we know the drill -- never play this game against compilers, because
you will lose.

So: we have a couple of those objects around in the writing routine
(cinfo, row_pointer), that violate the rules above.

Unfortunately we can't simply mark them as volatile: libjpeg's API
expects them not to be volatile. Casting volatileness away
and then touching an object in any way is undefined behavior out of the
bat (C 2x draft N2346 §6.7.3.7, C++ [dcl.type.cv]).

Given the code needs to do 3), and we can't work around 2), then work
around 1): define them to be non-local to the function doing the setjmp.
Introduce a small helper that declares such objects and then calls the
function doing the actual work, with the setjmp/longjmp.

An overall alternative would be of course stop using setjmp/longjmp, but
libjpeg's API doesn't really seem to allow this -- when the library
calls user's error handler, that error handler is expected not to return
to the library (so a longjmp or an exit/abort are mandatory).

Side note: all the code using libjpeg I've researched to debug
this has this very same strange issue:

* GDK-pixbuf's [1]
* ImageMagick's [2]
* and even libjpeg's [3] and libjpeg-turbo's [4] own examples.

[1] https://github.com/GNOME/gdk-pixbuf/blob/master/gdk-pixbuf/io-jpeg.c#L581
[2] https://github.com/ImageMagick/ImageMagick/blob/master/coders/jpeg.c#L2338
[3] https://www.ijg.org/
[4] https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/example.txt#L331

Change-Id: I34a810db468f73423478cd3ac71b888f4b11cb28
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-11 19:57:36 +02:00
Giuseppe D'Angelo
58c4fa1061 JPEG image handler: drop a use of "volatile"
The reading code protects a local variable with volatile. In this case
the only possible reason to apply volatile seems to be protecting the
variable across the subsequent setjmp/longjmp. However, the variable is
never accessed after the longjmp (the function returns). So, drop the
volatile.

Change-Id: Ibecb11a9edcc6027b2fd52b555287ad53375a5d0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-11 19:57:28 +02:00
Thiago Macieira
7fbadeddc1 Fix infinite recursion caused by the RDSEED feature
We made qRandomCpu() call qCpuHasFeature(), which needs to test that
RDRND works and does so by calling qRandomCpu(). So disentangle that by
making sure we don't recurse.

And by making sure that we fill the buffer with RDRND data, not with
RDSEED.

Fixes: QTBUG-79162
Change-Id: Ib5d667bf77a740c28d2efffd15cc583a9afcb97a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 10:55:52 -07:00
Johan Klokkhammer Helsing
6abbecf942 evdevtouch: Fix touch device count not being updated
When this was refactored in 3bc10fb9bb to use unique pointers, a move was
added before the connection, so it would essentially always try to connect a
nullptr.

Change-Id: Iab7fce88bc73afd78e6b63ffaef7358f3f4ce7e3
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
2019-10-11 16:32:52 +02:00
Volker Hilsheimer
1748dc3e2d QGroupBox: always disable children in a checkable, unchecked groupbox
The childEvent handler sets the enabled property of children as they are
added to the groupbox, but applications might later enable children and
check/uncheck the groupbox's checkbox in undefined order. In that case,
we would end up with enabled children inside a conceptually disabled
groupbox (the groupbox's checkbox represents the logical "disabled"
state), which breaks documented QWidget::enabled rules.

To make sure that all children are disabled as per the state of the
groupbox, we need to run that logic once the UI has been set up, and
before it becomes visible. This is what polishing is for, so listen
for that event in addition and handle it the same way as adding (which
duplicates things, but keeps existing code that might depend on things
being updated as they are added working).

Adds the case to the existing enabledChildPropagation test case.

[ChangeLog][QWidget][QGroupBox] Always disable children of a checkable,
unchecked group box before showing.

Change-Id: I978bd27b6f1a3f54ec745faeea529a98d0d93619
Fixes: QTBUG-25938
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-11 13:53:49 +02:00
Morten Johan Sørvig
81a7909693 Fusion Style: Use high-dpi pixmaps
Pass the QWindow as context to QIcon::pixmap(), which
enables it to return high-dpi pixmaps when needed.

Fixes: QTBUG-74100
Change-Id: I4556f0a98df8b6ba65376778379a03eb8c470d00
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-11 13:51:55 +02:00
Rainer Keller
23d7320852 Protect global variable g_pointIdMap with mutexes
The evdev touch handler is thread based and calls
QWindowSystemInterface::handleTouchEvent. The global variable
in qwindowsysteminterface.cpp is used without being protected by mutexes
which causes data loss and crashes when multiple touch screens are used.

Fixes: QTBUG-63584
Change-Id: I8b5bb04cc517fab96ac428b2bd2bc128b2ca1a54
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-11 12:51:23 +02:00
Eirik Aavitsland
c54083ff93 Fix QEasingCurve possible imprecision at endpoints
Both the spline curves and (most of) the predefines curves are defined
as having start value 0.0 and end value 1.0. The spline and In/OutBack
functions would sometimes not produce that result precisely, so code
could not reliably depend on expressions like (easedValue < 1.0)
becoming false. Fix by explicitly handling endpoints.

Fixes: QTBUG-76781
Fixes: QTBUG-72630
Change-Id: I21be43af469a76c090154bffef8406a9baf2d0b1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-11 12:29:27 +02:00
Tor Arne Vestbø
eaf4911db2 macOS: Optionally flush sub-layers via sub-image copies of the backingstore
When we're flushing the backingstore to sub-views with their own layers
we don't want to pay the cost of uploading the whole backingstore to the
GPU in the case where we're dealing with a discrete GPU.

To work around this we make a copy of the appropriate part of the surfcace.

This results in additional copies of the data, and will need further
investigation to limit these.

Task-number: QTBUG-77447
Change-Id: I318ae80e433dd7b0a55fd5a598b19f114d8bd28e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-11 12:28:58 +02:00
Tor Arne Vestbø
35713ef3ff macOS: Don't override event handler for kAEQuitApplication
The implementation of the default handler, [NSApp _handleAEQuit],
does a lot more than just terminating the application, including
sending NSWorkspaceWillPowerOffNotification if appropriate, and
deals appropriately with state restoration.

Change-Id: If725838fc0f40d09a0b8885eb3e7239499d8fea0
Fixes: QTBUG-18624
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-11 12:28:56 +02:00
Tor Arne Vestbø
e4e3be7501 macOS: Simplify reflection delegate handling in QCocoaApplicationDelegate
Sending a message to a nil object returns nil, so there's no reason to
check the delegate before calling respondsToSelector, and we can use
the implicit _cmd argument to pass along the selector for the method
we're in.

For applicationShouldTerminate, if there's a reflection delegate but
it doesn't answer to applicationShouldTerminate it makes no sense to
skip our own logic.

Change-Id: Iafcd883a5c8cec1b35d2f95238de55eff060d71f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-11 12:28:49 +02:00
Timur Pocheptsov
aa3540b7be QMacStyle - fix the background color for tool button
when it's in 'ON' state ("inverted" color in 'Dark' appearance).
Number are rather arbitrary and extracted with 'Digital Color Meter'
app to make it look similar to the native panel (to be honest,
this tool button on a toolbar not to be found in many native apps,
they use different buttons anyway).

Fixes: QTBUG-71526
Change-Id: Ie61e60b77f097f04550006612e4aab6f11bb954b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-11 11:59:41 +02:00
Edward Welbourne
60deb69034 Distinguish invalid datetimes from others
A default-constructed QDateTime is invalid, but compared equal to a
valid one referencing the start of 1970.  This lead to date properties
in QML being initialized invalid but not getting an onChange if the
first value they're set to is the start of 1970.

Fixing that then lead to some tests failing. Indeed, the original
equality check involved using toMSecsSinceEpoch(), whose value is
undefined unless the datetime is valid, without a prior check on its
validity: so ensure all uses of toMSecsSinceEpoch() are guarded with
isValid() checks.

Reworked tst_QDateTime::toSecsSinceEpoch() to use its bool column
(previously unused, after separating from toTime_t(), which uses this
column for "out of time_t's range") for validity of the datetime.

[ChangeLog][QtCore][QDateTime] Invalid datetimes are now treated as
equal and less than all valid ones. They could previously be found
equal to valid datetimes.

Fixes: QTBUG-79006
Change-Id: Ie72deb8af4350a5e808144d0f6e42dc8eb3ff5ef
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 11:59:41 +02:00