Commit Graph

38805 Commits

Author SHA1 Message Date
Joerg Bornemann
18a6c5ebe2 Fix QMAKE_LIBDIR_BCM_HOST for linux-rasp-pi3-g++
The directory must be prepended by = to denote the sysroot.
This amends commit 797f686e.

Change-Id: Ib85c0abc58fce3504ecccef0e223b2618ac9149a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-25 09:42:09 +02:00
Joerg Bornemann
c450e8bd20 Fix .la/.pc replacements if libdir is in QMAKE_DEFAULT_LIBDIRS
We must use the same two-level replacements like for .prl files.
This amends commit d5071a40.

Change-Id: Iea065d01dee61cf2d1ff78640d045c3c76db9ac8
Fixes: QTBUG-76625
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-06-25 09:17:07 +02:00
Johan Klokkhammer Helsing
53da86fe8c Add a QVkConvenience class with vkFormatFromGlFormat
Converts from OpenGL formats to Vulkan formats.

There are commented out lines for the formats in QOpenGLTexture::TextureFormat
for which it was hard to find an unambiguous mapping to vkFormat.

Task-number: QTBUG-75108
Change-Id: I06a7fd8df7d98cef314410ffd79ca9cff6599357
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b21b07877a)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-06-21 11:19:58 +02:00
Ulf Hermann
084e17c4e1 Avoid undefined behavior in qjsonwriter.cpp
See comment in qnumeric_p.h:convertDoubleTo for details.

Change-Id: Ifcd13f7f67995af6a60e50ccabe843a855be04ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-20 12:19:00 +02:00
Morten Johan Sørvig
b6ded193ee QHighDpi::fromNativePixels: use correct screen
Calls like
	QHighDpi::fromNativePixels(point, window)

would return device independent coordinates outside any
screen in cases where the window is spanning multiple
screens and the native point was not on the main screen.

Correct this by looking up the correct screen and use
its scale factor and origin when scaling coordinates.

Task-number: QTBUG-73231
Change-Id: I01a3a42f42121b8d9f4ced2bb0fb023d6ae6bfe7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-19 15:05:15 +02:00
Tor Arne Vestbø
244ff33119 styles example: Use QImage instead of QPixmap in NorwegianWoodStyle
Using QImage allows creating the style before the application has
been created, and is the more modern API.

No changes to the documentation needed.

Change-Id: Ifa0e5fa1113802fca18fbd45bb3c0a5ba1dbfeab
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-06-25 20:08:26 +02:00
Friedemann Kleint
530c6903a4 Brush up Diaglib
Fix most clang warnings about override, nullptr, range-based for loops.

Change-Id: Id47e57adb63a38e2f397a31511b788a2432c97cf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 08:56:00 +02:00
Andy Shaw
9be66cb282 Android: Use Android button layout for the DialogButtonBoxLayout hint
Fixes: QTBUG-70045
Change-Id: I9c51e9a769f510a6f14f6e9d78583caf3df15031
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-18 11:04:22 +00:00
Volker Hilsheimer
0f3f143f6d Fix window shortcuts when a completer popup has focus
The completer popup has focus, making QShortcut direct to it's window
rather than to the window the completer belongs to. As QShortcut handles
the case for Tool windows that have a parent, but doens't do the same
for popups. And they shouldn't be treated the same way, as a context
menu popup for a e.g. text edit should in fact block the text edit's
shortcuts while open.

However, the completer popup is special, in that it explicitly makes the
widget completes for its focusProxy, which is what we can use to fix
this issue.

Change-Id: Ie7177d39668b3af14a1d9e0ee5d93eca9c67c8af
Fixes: QTBUG-4485
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-25 00:04:15 +02:00
Joerg Bornemann
f6db25962e Add QDebug streaming operator for ProString
This saves us lots of .toQString() and .toQStringList() typing when
qDebug()'ing qmake code.

Change-Id: I037e5e1816f2dcb6a20dec4c275f3d886f155ad5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 17:40:07 +02:00
Joerg Bornemann
3a806254fe Fix 'clean' target for MinGW DLLs
'make clean' removed the import libs for DLLs which makes them quite
unusable. Move the import lib removal to the 'distclean' target.

Fixes: QTBUG-51977
Change-Id: I727d520435f88a83a7fb14cb0ad81f8fe7c6d61b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 17:18:20 +02:00
Timur Pocheptsov
5b5e8f78fe NSMenuItem/NSMenu - set the submenu properly
... in case the submenu is set from a slot, attached to the aboutToShow()
signal. Normally, with a 'statically' pre-populated menu, we set 'submenu'
property on a menu item from 'updateItem' callback in our menu delegate.
After that, AppKit calls our delegate's willOpen call back and this is
where we emit 'aboutToShow'. Unfortunately, if an application tries to
create a nested menu 'dynamically' at this point, it never becomes 'submenu'
of the item, since 'updateItem' was already handled at this point.

We catch this case in QCocoaMenuItem and call setAttachedItem if needed.

Fixes: QTBUG-76060
Change-Id: I676bf1d8529b9ddbfc90e4dff422b39668b7a5fa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-21 15:12:57 +02:00
Christian Ehrlicher
a7cbb8c639 QWidget: fix setTabOrder for compound widgets
81e298a51d fixed a case where the focus
chain was screwed up when the order was already correct. This worked
correctly in most cases but not when the next focus widget of the first
one had Qt::NoFocus.
The optimization check if lastFocusChildOfFirst is the same as second is
thrown away since it now does not longer screw up the focus chain and
the save would only be four pointer assignments.

Fixes: QTBUG-75388
Task-number: QTBUG-10907
Task-number: QTBUG-68393
Task-number: QTBUG-69619
Change-Id: I581ed532156c34ea970123afd063194aab016304
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-10 13:44:42 +02:00
Mårten Nordheim
a489e11b97 Temporarily skip tst_QSslSocket::resume
Will be reverted once ready

Change-Id: Id03df7dea1dd65579ec83606fddf2a73a45a0d64
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-24 15:18:48 +02:00
Mårten Nordheim
42f3b18ec9 SSL: Update an about-to-expire certificate
Change-Id: I9e29baf529b74ae33fa0ee7250e5af6b1873e86f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-24 15:18:47 +02:00
Thiago Macieira
0e1623158b Fix GCC 9's warning about deprecated violation of Rule of 5
error: implicitly-declared 'QDistanceField& QDistanceField::operator=(const QDistanceField&)' is deprecated [-Werror=deprecated-copy]
note: because 'QDistanceField' has user-provided 'QDistanceField::QDistanceField(const QDistanceField&)'

Change-Id: Ie7ae7616eadf4035bec6fffd15aabc58e99632d9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-06-23 07:03:38 +00:00
Tor Arne Vestbø
674f4e6cfb QApplication: clarify and unify global static usage
Explain why there are two accessor functions for the global statics,
and use the global statics directly inside qapplication.cpp for
consistency.

Change-Id: Ibf3952052c1d0e780a8aab220a72f05af0c070a5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-21 14:22:00 +02:00
Tor Arne Vestbø
ed00e3093b Remove duplicate call to QApplicationPrivate::setPalette_helper
initSystemPalette() already takes care of this.

Change-Id: I6521763a74ec3ec629d9fcf05aa2a7cd71a7f26d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-21 14:22:00 +02:00
Tor Arne Vestbø
cbb0295f7b Remove duplicate call to QApplicationPrivate::initializeWidgetPaletteHash()
initSystemPalette() already calls this when there's a platform theme, which
is the only case where initializeWidgetPaletteHash will have an effect.

Change-Id: I814ea2bb17ef40aee769f2c36f8ef4296cfca020
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-21 14:22:00 +02:00
Tor Arne Vestbø
cea661d395 Squash un-needed qt_init function into callsite
Only uses a single place and avoids following the init logic through
multiple layers when trying to debug it.

Change-Id: I8fc119385edf407f69fb5431dc6584288022a7fe
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-21 14:22:00 +02:00
Tor Arne Vestbø
d848c3dfea Remove dead code from QApplicationPrivate::setSystemPalette
The code was added in 2005, ifdefed out already, and never used.

Change-Id: Ic5d070dd031665a4429739278851b50646694bf9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-21 14:22:00 +02:00
Volker Hilsheimer
cfd2cc91fd Always fill the background of a tabbed QMdiSubWindow
QMacStyle polishes QMdiSubWindows to have autoFillBackground set to
false. If the QMdiSubWindow's widget also doesn't fill the background
(like QLabel), then nobody fills the window in a tabbed QMdiArea, and
the other subwindows show through.

This change makes sure that all pixels are painted in that situations,
using the styled frame.

Fixes: QTBUG-76214
Change-Id: Iae025d15d36a8bc0d0c5838ac43c9d54944bcc83
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-21 13:09:46 +02:00
Timur Pocheptsov
a22a6c01f8 Revert "tst_qnetworkreply - QSKIP/disable tests that deadlock on Windows"
QSslSocket (OpenSSL backend) does not use mutex/locks during
a handshake, so we re-enable previously skipped tests.
This reverts commit 8c87a1402c.

Change-Id: I994b085f016f0eb18b3ba439a7041ea08cd3577b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-21 09:54:09 +02:00
Shawn Rutledge
82da8306bc Deal with multi-display scenarios when positioning menu popups
This is to support rare setups involving an X11 server with multiple
independent displays ("zaphod heads" on which the DISPLAY env var
is different), possibly with multiple outputs forming a virtual desktop
on each display.

QMenu::popup() has been assuming that it should show on the screen where
the mouse cursor is.  That's good most of the time; but with multiple
independent screens, QGuiApplication::screenAt(pos) cannot tell us which
screen to use (it's ambiguous), but rather will choose the first screen
that _could_ contain that position (as documented).  In the example in
QTBUG-76162, the QMenu has been constructed with a QDesktopScreenWidget
as its parent specifically for the purpose of telling it which screen to
pop up on; so we need to respect that.  But QWidgetPrivate::init() sets
the QObject::parent() to null (because the widget isn't actually shown
as a child of the QDesktopScreenWidget), and QWidgetPrivate::create_sys()
sets initialScreenIndex back to -1 to provide freedom to change the
screen later; so QMenu has to remember the screen index for itself.

QMenuBarPrivate::popupAction() searches the siblings of the screen on
which the menubar is claiming to be (rather than all screens on all
displays), to find the screen containing the point at the middle of the
bottom edge of the clicked menubar item.  It then sets initialScreenIndex
so that QMenu::popup() will respect it rather than trying to decide for
itself.

Fixes: QTBUG-76162
Change-Id: I7a8f8e7aa2e9cf5340d446dc12726369ebe2589a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-21 11:43:46 +02:00
Allan Sandfeld Jensen
121692e540 Use Xft DPI as basis for HiDPI scaling
GNOME indicates DPI modes by setting high DPI values in Xft.DPI, so
we need to use the forced DPI setting instead of the real DPI, as basis
for QPA pixel density.

Change-Id: I6f25636383b16b89a3d5fe4c904afd079fe001aa
Fixes: QTBUG-74836
Task-number: QTBUG-65424
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-19 18:02:48 +02:00
Kai Koehne
29670528d8 Qt D-Bus: Document CMake commands
Task-number: QTBUG-72159
Change-Id: I4b2f29a9d976f4b81acef3170b90016d2e8b5ef8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-06-21 11:04:05 +02:00
Rolf Eike Beer
47691260ca move ENDSESSION_* compat defines to before they are actually used
This commit amends 144d33df72.

Change-Id: Ic6bc475c9d8c3bb727ee209dbab437a18e219b6d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-13 11:15:49 +02:00
Thiago Macieira
0ef6150005 QCborValue::fromJsonValue: rewrite code to remove UB
Converting an out-of-range FP to integer is UB. See comment in
qnumeric_p.h.

Change-Id: Ief874765cd7b43798de3fffd15a9bfe2c5fbbc01
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-06-19 17:15:39 -07:00
Laszlo Agocs
eb144c3c4d Release program when returning from QOpenGLTextureBlitter::create()
Change-Id: I27b9496f9a58ceabc613372463543068cb432bdc
Fixes: QTBUG-60453
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-06-19 12:37:51 +02:00
Allan Sandfeld Jensen
a1634fb741 Fix controlling gdb_index from configure line
Used the wrong feature name

Change-Id: Ie32adb8bb9dd142927aea7d88aa10b9b87030681
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-20 09:14:24 +00:00
Frederik Gladhorn
73a19a3a10 Stabilize tst_qsplitter
This is the worst fix ever, adding one more qWait. The test has been
updated in the 5.13 branch, so there a different fix will be needed. For
now this is in line with the rest of the code.
This test is currently one of the worst offenders when it comes to flaky
tests.

Task-number: QTBUG-64639
Change-Id: Ia1e71cc948997408b9658839013c9ad098111033
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-19 18:32:19 +02:00
Tor Arne Vestbø
7940791f47 Report correct state change when destroying QAbstractAnimation
Change-Id: Ibe5310e20268d1baa5b329a4d02a3dc38d875008
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-20 12:46:30 +02:00
Tor Arne Vestbø
25eb0408a6 macOS: Don't capture local Q_D in QMacStyle
Change-Id: I01f14295e7e383b583931fc22e3d43151f7918b0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-06-19 16:42:47 +02:00
Timur Pocheptsov
fe6e54fb1f TLS socket: make verification callback lock-free (OpenSSL)
When our QSslSocketBackendPrivate (OpenSSL backend) was developed,
the ancient versions of OpenSSL did not have an API needed to pass
an application-specific data into verification callback. Thus the
developers resorted to the use of global variables (a list with errors)
and locks. Some of our auto-tests use QNAM and in-process server.
Whenever the client (essentially qhttpthreadeddelegate) and the server
live in different threads, any use of 'https' is dead-lock prone,
which recent events demonstrated and which were previously observed
but not understood properly (rare occasions, not always easy to
reproduce). Now we fix this for good by removing locking.

There are two places (in 5.12) where these locks are needed:

1. Before calling SSL_connect/SSL_accept (handshake) - here
   we reuse the same trick we do in PSK callback ('SSL' has
   an external data set, and it's 'this', meaning an object
   of type QSslSocketBackendPrivate).

2. The static member function 'verify', here we do not have
   'SSL', but we have our temporary 'X509_STORE', to which
   we can directly attach an external data - a pointer to
   a vector to collect verification errors.

Note, this change assumes that OpenSSL Qt is build/linked
against is at least of version 1.0.1 - we set external data
on SSL unconditionally (no version checks).

Fixes: QTBUG-76157
Change-Id: I05c98e77dfd5fb0c2c260fb6c463732facf53ffc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-17 15:21:11 +02:00
Volker Hilsheimer
c086fc7341 Report correct data when multiple volumes are mounted to the same path
We read the data into the iterator from the system, but then recreate
the QStorageInfo object based on the rootPath, and then stat, discarding
the data in the iterator.

We can overwrite the data with the information in the iterator, which
partially fixes the issue. Volume information that can only be retrieved
by stat'ing the root path, such as size information, will only be
correct for one of the entries.

Change-Id: Ie98590876d6a5f525af009f4ff5d595cbc308b3f
Fixes: QTBUG-63209
Reviewed-by: Andrius Štikonas <andrius@stikonas.eu>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-19 20:11:19 +02:00
Paul Wicking
6398588338 Doc: Fix typo in brief
Fixes: QTBUG-76512
Change-Id: I8db4288b22416c6af9aaaa72c5005b81d79bf620
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-06-19 15:18:50 +02:00
Tor Arne Vestbø
6fa5dfddf8 Don't hardcode compiler when building headers
Normal sources are built using $(CXX), which is defined in the makefile,
but can be overridden. We should do the same lazy evaluation of the
compiler for headers.

Change-Id: Ic548786bd18ed8fb7eb0b58a527615ab19000323
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-06-13 14:11:50 +02:00
Tor Arne Vestbø
d5adaacbb2 macOS: Make QMacStyle::standardPalette() reflect the platform theme
This palette isn't usually used, and the platform theme's palette is
preferred, but if a client asks for the standard palette (e.g. as
used in the styles example) we should try to report a palette that
gives the system look.

Change-Id: Ie5e58c890c13c716a9e9b5093b954a737e550dee
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-19 11:43:14 +02:00
Friedemann Kleint
6d61b10f65 High DPI: Fix crash in QWindow::mapFromGlobal()
With Web Engine, QQuickWidget or similar, the code can hit on the offscreen
window, when its handle is null. Add a check.

Amends 3af7b27917.

Fixes: QTBUG-76440
Change-Id: I123633d18386efd3dbfb22aad6072e4f0877a62e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-19 08:34:01 +02:00
Frederik Gladhorn
a3e69954f5 Add accessibility notification role
On Linux this role is needed to make desktop notifications work.
There is no equivalent for Windows, iOS or macOS. On these platforms the
role will have no effect.

Fixes: QTBUG-76333
Change-Id: I4ef3b3321f7a0e2c09c1ce432a668428d14c52b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-06-12 10:29:45 +02:00
Morten Johan Sørvig
1975a98345 macOS: prevent duplicate backing store scaling
m_requestedSize is already scaled by the QtGui scale
factor (e.g. as set by QT_SCALE_FACTOR). Multiplying
by QWindow::devicePixelRatio() then applies this factor
again.

Use QPlatformWindow::devicePixelRatio() instead, which
returns the platform scale factor.

Change-Id: I133e99d84f4718215fda9ef0cf81a113b51db2c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-19 13:12:59 +02:00
Richard Moe Gustavsen
084f84d112 QVector3D: fix documentation spelling error
Change-Id: Id3b97ea3ce45452e0b59986bc4fd84fd9b0d3708
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-19 10:25:57 +02:00
Michal Klocek
b68a9df076 Fix bogus setAttribute setter warning
Since e9e16c7464 running webengine application you can get
warning "Attribute Qt::AA_ShareOpenGLContexts must be set before
QCoreApplication is created."

WebEngine set shared open gl context on qt_call_pre_routines, so
when QCoreApplicationPrivate init() runs.

Fixes: QTBUG-76391
Change-Id: I5fc146ed70054b0c1597fe06615cea2d7a8969d8
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-06-19 08:42:35 +00:00
Tor Arne Vestbø
f344b6357e macOS: Invalidate window shadow after QNSWindowBackingStore resize
The window shadow rendered by AppKit is based on the shape/content of the
NSWindow surface. If the backingstore is partially transparent, we need
to invalidate the window shadow after each resize (and subsequent flush)
of the backingstore.

Change-Id: I451370af5a8c0c25faea26beb3faa2483a33a5cf
Fixes: QTBUG-74560
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-18 14:59:56 +02:00
Tim Blechmann
cf052e0737 Windows: Use UUIDs instead of function pointer to mangle window classes
Instead of using the address of a function pointer, we name-mangle window
classes by using an UUID.

This fixes a real-world problem with multiple Qt instances where for some
reasons the window function appears to be mapped to the same address.

Change-Id: Id27e8d7aa17a4db9c14559224395f49d3ecd8d78
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-18 10:40:06 +00:00
Christian Ehrlicher
b568e93149 QSS/MenuItem: only draw checkbox if no item is available
QTBUG-66380 introduced a behavior change drawing a checkable menu item
with an icon. After this path the checkmark and icon was drawn.
Revert this regression so the stylesheet style matches the behavior of
all other styles. A checkable item should have two different icons
(QIcon::On and QIcon::Off).

Fixes: QTBUG-74655
Task-number: QTBUG-66380
Change-Id: I32ac2f397087a1c3d5d07400372109703c00c1ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-17 20:46:36 +02:00
Frederik Gladhorn
8e528d8bd0 iOS Accessibility: implement accessibilityElements and check indexing
Fixes: QTBUG-70683
Change-Id: I122c67a5cee22363de5c8e45dc1c83e7760162fb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-21 12:31:07 +00:00
Thiago Macieira
36c6b7ee4d Append LTCG arguments properly
If the QMAKE_CXXFLAGS already had -ffat-lto-objects, the *= wouldn't add
it it again, after our "-flto -fno-fat-lto-objects", which meant the
last one would stand.

Change-Id: Ic9cfa6256b5045caa6e6fffd15a7f6cda7aaa837
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-13 23:02:22 -07:00
Morten Johan Sørvig
7ae2f47214 QHighDpi: Replace fromNative()/toNative() with scale()
We need one scale() function for each type: the scale factor can be
inverted by the caller for the fromNative case. Add a generic
templated implementation which will handle simple types. Add add
specialization functions for compound types that don't have
operator*(), as well as for position types (e.g. QPoint) which account
for the origin.

There's no need for fromNativePixels() and toNativePixels() overloads
for each type; replace with generic implementations which call
scale(). Do the same thing for fromNativeLocalPosition().

Some user code is calling fromNative()/toNative() directly, so leave a
definition of those functions around for now. Also leave a couple of
one-off scaling functions which do not fit the pattern.

Also fix “narrowing conversion scaleFactor to int” warning for the
QMargins scale function.

Change-Id: Ia67accbb670a80dc1747c2e264b97aab75b1251b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-14 19:31:41 +02:00
Morten Johan Sørvig
09a2a9bc4a Cocoa: always send queued user input events
User input events will be queued if processEvents()
is called with the ExcludeUserInputEvents flag. User
code then expect that the queued events will be sent
when the corresponding exec() call returns.

We were sending queued user input event at the beginning
of processEvents(). However, the cocoa event dispatcher
also has a mode where it makes a blocking call to
[NSApp run], in which case processEvents() never returns
during event processing. This means we don’t get to call
the queued-event-sending code.

Factor out the queued-event-sending code to a new
sendQueuedUserInputEvents() function. Call it from
postedEventsSourceCallback() to make sure the queue
is emptied after the ExcludeUserInputEvents processEvents()
call is done.

Task-number: QTBUG-69687
Change-Id: I4ff554ef4d39a69356736c33a650886b56bfdb4c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-03-21 12:53:24 +01:00