Commit Graph

33944 Commits

Author SHA1 Message Date
Thiago Macieira
82c787ec3b Fix build on Integrity: the compiler doesn't understand this construct
"global/qrandom.cpp", line 155: error #2000-D: attribute "destructor" is not implemented and will be ignored

Task-number: QTBUG-63948
Change-Id: Icaa86fc7b54d4b368c0efffd14efa35381d4e797
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-10-23 14:21:11 +00:00
Liang Qi
ae03f905d6 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-23 16:14:07 +00:00
Alexandru Croitor
87eff0ea31 Fix resolution of QMAKE_INFO_PLIST for non-bundle artifacts
Change-Id: Id56cea1f09d7675fe60cdbd598e6f585a6b230d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-23 13:50:45 +00:00
Liang Qi
32f50225c4 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/direct2d/direct2d.pro
	src/plugins/platforms/ios/qiosclipboard.mm
	src/plugins/platforms/windows/windows.pro

Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
2017-10-23 09:40:54 +02:00
Sami Nurmenniemi
9c58dd1588 Blacklist and skip failing tests for Boot2Qt / 64 bit arm
Task-number: QTBUG-60263
Change-Id: I05978915b5bb7ae31069e8e9ae1dc273e483ddb0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-10-21 09:31:01 +00:00
Dmitry Shachnev
88e6f8cff2 Fix implementation of spell check underline styles
The QTextCharFormat documentation said that the used style is based on
QStyle::SH_SpellCheckUnderlineStyle style hint, however in fact the
implementation (drawTextItemDecoration in qpainter.cpp) uses
themeHint(QPlatformTheme::SpellCheckUnderlineStyle) instead since Qt 5
(see commit 1f9ae50457).

Make the documentation match that behavior, and update QPlatformTheme
to use the correct default value.

Also, switch Cocoa theme to use DotLine, as that is what native macOS
applications use.

Change-Id: I2a6bb3da6c7b0686dca87ed2c251b6abc006123c
Task-number: QTBUG-50499
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-10-21 08:45:20 +00:00
Thiago Macieira
c90d9f95d2 QRandomGenerator: improve floating-point random generation
The previous version was good, just not optimal. Because the input was
an unsigned 64-bit number, compilers needed to generate extra code to
deal with HW instructions that only convert 64-bit signed input. And
that was useless because a double uniformly distributed from 0 to 1 can
only have 53 bits of randomness.

The previous implementation did exactly what the Microsoft libstdc++ and
libc++ implementations do. In my opinion, those implementations have an
imperfect distribution, which is corrected in this commit. In those, all
random input bigger than 0x20000000000000 has a different frequency
compared to input below that mark. For example, both 0x20000000000000
and 0x20000000000001 produce the same result (4.8828125e-4).

What's more, for the libc++ and MSVC implementations, input between
0xfffffffffffff001 and 0xffffffffffffffff results in 1.0 (probability 1
in 2⁵³), even though the Standard is very clear that the result should
be strictly less than 1. GCC 7's libstdc++ doesn't have this issue,
whereas the versions before would enter an infinite loop.

Change-Id: Ib17dde1a1dbb49a7bba8fffd14eced3c375dd2ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-20 18:10:33 +00:00
Thiago Macieira
68092ba6c0 QRandomGenerator: fix the timing of the closing of the Unix random fd
Let's make it happen even later: at the time of QtCore's unloading from
memory. This prevents issues with something using QRandomGenerator after
the global static destructor would have run.

Change-Id: Icaa86fc7b54d4b368c0efffd14eed56bbbb51cb6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-20 18:10:31 +00:00
Błażej Szczygieł
8aadfbc657 xcb: Convert synthetic mouse enter event position to native pixels
Mouse position is converted from native pixels later, so we must
provide native pixels for "QWindowSystemInterface::handleEnterEvent".

Amends 7091be1b79

Task-number: QTBUG-63865
Change-Id: I813c171f2fc1d321af702ac30eb5f2e4232e97c4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-20 08:06:03 +00:00
Friedemann Kleint
571b11d41c Windows QPA: Fix build with -no-feature-tabletevent
Guard #include by QT_CONFIG.

Task-number: QTBUG-63874
Change-Id: I33f4a4c4fbdae3d25874ee9cdc3f1c7e1ab783e3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-10-20 08:05:57 +00:00
Friedemann Kleint
dcc8aa8f4e Windows/Direct2D QPA: Fix build with -no-accessibility
Task-number: QTBUG-63876
Change-Id: Ib9216977dd495e05d032e679c2f23ffe6a6953a6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-20 08:00:56 +00:00
Oliver Wolff
c05268222c winrt: Fully initialize CREATEFILE2_EXTENDED_PARAMETERS struct
Not properly initializing all members of the extended parameter struct
will cause an "invalid handle specified" exception on use.

Task-number: QTBUG-63883
Change-Id: Ic3a58df864c9e29ccbadc04bd71c18c8ef34374c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-10-20 07:46:52 +00:00
Friedemann Kleint
34c879f2e1 QNativeGestureEvent: Fix qdoc warning
Rename the parameter back to 'device', fixing:
src/gui/kernel/qevent.cpp:2776: warning: Undocumented parameter 'dev' in QNativeGestureEvent::QNativeGestureEvent()

Amends 36af37c99c.

Change-Id: I2a3f016dd6a5dda784dc851a052cb5aa1841a472
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-20 06:15:52 +00:00
Gabriel de Dietrich
c99d8532c8 QCocoaSystemTrayIcon: Remove unused classes
Both QNSMenu and QSystemTrayIconQMenu aren't referenced anywhere
else, including within qcocoasystemtrayicon.mm, since the QPA
backend was added.

Change-Id: I632c1b230226b2d08afce7f0f0019e9f7c030ba5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-20 03:22:16 +00:00
Thiago Macieira
02dc39fa8e QBasicMutex: mark the bootstrap constructor constexpr
QBasicMutex and QMutex are the same in bootstrap mode.

Change-Id: Icaa86fc7b54d4b368c0efffd14eed63343ddb51b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-10-19 15:43:26 +00:00
Richard Moe Gustavsen
6c1a2224f3 iOS: add support for adding mimetypes other than text on the clipboard
A QVariant can only be converted to a QByteArray if it has user type
QMetaType::QByteArray or QMetaType::QString. The way it stood, we
always tried to convert the mime data to a QByteArray, and
then put the result into a QVariant. This would fail if the mime
data contained e.g a QPixmap.

This patch will inspect what kind of data the QMimeData contains, and
convert it to a QVariant using the expected API.

Backport of 6d3c483

Task-number: QTBUG-57428
Task-number: QTBUG-63660
Change-Id: I09b4a94aef7b52773e1a79c468ead71b36dfbfc5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-10-19 13:30:09 +00:00
Mårten Nordheim
fc98878658 Fix cookie path matching for empty url path
The path wouldn't match if the cookie's path was root ('/') and the
URLs path was empty.

Change-Id: I6dcd10f1fdf4f48f14e50f1b169cbdfda7005849
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-19 12:51:38 +00:00
Orgad Shaneh
ca5f5de5c9 GitIgnore qvkgen
Change-Id: I6f6551821ffcd73841e4b5cab5892bd17f5c70b9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-19 10:59:09 +00:00
Orgad Shaneh
0354ba816f Clean dynamic function resolving done for XP in QFileInfo tests
Change-Id: I15364b1e8c4f4406fef2be68ca221a8867d0dcfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-19 10:59:04 +00:00
Orgad Shaneh
d57a7c4171 MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 API
Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-19 10:58:59 +00:00
Gabriel de Dietrich
f13e75345d Cocoa QPA: Remove usage of OBJECTIVE_SOURCES
Change-Id: I5924ab0ddb442624f5aeeef023428be228348707
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-19 10:06:17 +00:00
Robert Loehning
37afba28b1 QTableGenerator: Fix handling of illegal characters in fromBase8 again
Change-Id: Iaee19f71e5b74b0d43b628739039ca3c2be60cd0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-10-19 09:15:15 +00:00
Friedemann Kleint
0521913676 QTabletEvent: Add doc note about Windows drivers
Recent drivers no longer contain wintab32.dll, point out a version
that still has it.

Change-Id: I4125a0af3c11ab739f8006b91f58899aeed54458
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-18 19:50:10 +00:00
Thorbjørn Lund Martsum
a1c985c10b QAbstractItemView: Make it easier to drop above and below items
Before this patch a very accurate drop position below
or above an index was needed. Therefore it was not that
easy to do.

This patch increases the above/below area to be about
18% of the item (still leaving the most space for the item).

An average user will likely be 2-3x faster with dropping
below or above (while not losing much when dropping on items).

[ChangeLog][QtWidgets][ItemViews] Made it easier to
drop above and below items.

Change-Id: I47f0f80c76878c17ebf3f93d0a0cc82755971c2a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-10-18 10:45:21 +00:00
Nico Vertriest
03c3ba1815 Doc: improve screenshots Application Example
Task-number: QTBUG-60635
Change-Id: I963ecbf0b386e9f5d41b4c15e2af883cf21d3c83
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-10-18 10:43:49 +00:00
Nico Vertriest
19ae653f7f Doc: qtwidgets index page: wrong name for image file
windowsvista-treeview.png --> windows-treeview.png

Change-Id: I19ccec1ff5fadf2107ad47109d65f170df4b0505
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-10-18 10:43:40 +00:00
Nico Vertriest
a92cf24f9c Doc: correct filename png files
qpushbutton.h:55: warning: Missing image: windows-pushbutton.jpg
widgets.qdoc:28: warning: Missing image: windowsvista-treeview.png

Change-Id: I2ebf2aa809f8d532f597624f6ed2f9d636e860a6
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-10-18 10:43:26 +00:00
Nico Vertriest
6889626164 Doc: replace screenshot widgets tutorial with more updated version
Change-Id: I2b4fcd02c13fcd6569ebf035197da361aba40afd
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-10-18 10:43:13 +00:00
Friedemann Kleint
879f98106d Revamp QtWidgets/DragAndDrop examples to C++11
Introduce nullptr and replace foreach with new C++11 range based for
loops. Minor fixups of signals, file dialog usage.

Apply the same changes to the ItemViews/puzzle example since it
shares parts of the code with DragAndDrop/puzzle. Make some
changes to both examples to that the diff of the two becomes
small for easier comparison.

Task-number: QTBUG-60635
Change-Id: I8af824229ebac24d6ec151eae92176d227695490
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-18 10:31:44 +00:00
Liang Qi
3fd641c314 network: add a QT_CONFIG(bearermanagement) guard
for QNetworkReplyHttpImplPrivate::startWaitForSession().

This amends 8a39384e90.

Task-number: QTBUG-63847
Change-Id: Ic20a4ac3ab97ed25010e0679810ef64c3ff42c05
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-18 09:36:35 +00:00
Thiago Macieira
3fe74b76fd QHostInfo: Make getaddrinfo() mandatory
All systems must implement it by now. If there's any system still
without it, that means it has no IPv6 support, so they can disable
QtNetwork entirely.

[ChangeLog][Deprecation Notice] Starting with Qt 5.10, IPv6 support is
mandatory for all platforms. Systems without proper IPv6 support, such
as the getaddrinfo() function or the proper socket address structures,
will not be able to build QtNetwork anymore.

Change-Id: I3868166e5efc45538544fffd14d8c28046f9191b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-18 09:26:43 +00:00
Friedemann Kleint
3760bc7590 QTabletEvent/manual widgets test: Fix reporting of proximity events
Proximit events are sent to the QGuiApplication, catch them via
event filter.

Change-Id: I7f896e7d9f5c90347b9e3c708feb69abd1c5fc95
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-18 06:20:49 +00:00
Friedemann Kleint
dc03ac15b0 QTabletEvent/manual widgets test: Port to C++ 11
Change-Id: If5ebb45ce286d6a96c9f8bfe1fac70661d065460
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-18 06:20:45 +00:00
Mårten Nordheim
c4cf90b1f7 Fix redirecting POST for HTTP 307 and 308
All POST requests that were redirected would previously turn into GET
requests. This does not follow the standard for HTTP codes 307 and 308.

Task-number: QTBUG-63142
Change-Id: Ibd25a9566066e589670a9bc34e5dc5111f8139d5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 18:50:14 +00:00
Mårten Nordheim
c5b7a3c922 Windows: Fix inability to have two topmost windows
Task-number: QTBUG-63621
Change-Id: I4ee6885d19907bff553149bef9efcffb209eb1f5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-17 18:08:41 +00:00
Liang Qi
7e4571b7e7 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-17 18:29:37 +00:00
Alexander Volkov
66119a07e8 Address Book example: Replace QPair by struct
Introduce Contact struct to store contact data and use it
instead of QPair<QString, QString>. Proper naming really
clarifies the code.

Task-number: QTBUG-60635
Change-Id: Ibfb421dfc854accc382212b0da46e7aafc0d528a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-17 16:42:55 +00:00
Mårten Nordheim
8a39384e90 Open a session during redirects when needed
In some cases when a session isn't needed (i.e. for localhost), the
session is not opened at all. If a program (e.g. our tests) redirects
from localhost to a different system (e.g. the qt network test
servers, or the internet) it will wait for a session forever. So, we
need to check if a session is needed for the redirect-target and then
open one. It is usually opened in
QNetworkReplyHttpImplPrivate::_q_startOperation

Change-Id: Id3b78182a3fb3f63f0235ecb1fb665df8bd0c4ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-17 14:22:22 +00:00
Gatis Paeglis
377d2502e3 tests: make exposeEventOnShrink_QTBUG54040 not flakey on xcb
From: https://tronche.com/gui/x/xlib/events/exposure/expose.html

"The circumstances in which the X server generates Expose events
are not as definite as those for other events."

On windows with XCB_GRAVITY_NORTH_WEST flag set we should not get
expose events according to e2665600c0,
but as stated earlier this might not always be true.

Nevertheless, sometimes we get expose event from X server when shrinking
window, but most of the time we don't. Make the test not flakey by
checking that we get at least 1 expose event, instead of exactly 1.
Now running test 500 times in a loop does not fail.

Task-number: QTBUG-63424
Change-Id: I8004e622020cc09e11b7d592faf6d9ee1b9cfee2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 542e11ab2b)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-10-17 13:58:36 +00:00
Gatis Paeglis
0aba5546ef tests: fix and un-blacklist tst_qgraphicsview::hoverLeave
Tests should not use QCursor to emulate mouse move, see QCursor::setPos() docs.

The flakiness of the test on XCB is not surprising when the test queries geometry
even before the window has been shown. With the re-factored version I could not
reproduce flakiness anymore.

Removed Q_OS_MAC and closed QTBUG-26274 as test passes on macOS from which I
assume that the underlying issue has been fixed.

Removed Q_OS_QNX ifdef as test does not rely on QCursor anymore.

This patch also fixes the issues on minimal / offscreen platform plugins.
QCursor::setPos() is evil for auto test purposes.

Note:

We intentionally use QTest::mouseMove(QWindow *window, ..), not the QWidget overload.
The QWindow version gets routed through QWSI, which ensures that all necessary events
are generated as expect. In QWidget code path this is currently disabled by
QTEST_QPA_MOUSE_HANDLING.

Change-Id: I285c26cff09e3f2750f8c2abbb1f46c8f7be984a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1af927976a)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-10-17 13:58:29 +00:00
Timur Pocheptsov
db333d6dba QNAM (redirects) - clear 'raw' headers before sending the next request
We already cleared 'cookedHeaders', which is a QHash for 'known headers'
(enumerators as keys instead of strings), now do the same for 'rawHeaders'-
not to end up with some weird mix of headers from all possible redirect
responses and the final response.

Task-number: QTBUG-61300
Change-Id: Ifd6655c4167840bb00d29446d36ce65ba2d5491a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 13:58:16 +00:00
Kai Koehne
574c8ec13c Doc: State that qDebug and friends are thread-safe
There's a common misconception that qDebug and friends are not
thread-safe, so let's explicitly state this.

Change-Id: I48d4ab8983017a9f2e7c9932a49ed573baa22929
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-17 13:57:45 +00:00
Frederik Gladhorn
8fcf171b42 Android Accessibility: protect from accessing invalid interfaces
I am not sure if this is going to help, but it is required that the
bridge checks that the interfaces it accesses are valid, since that
protects from accessing them when they are in the destructor.
This should be done, whether it fixes the issue or not.

Task-number: QTBUG-45855
Change-Id: I2b96999ca4043f8b33607c864d1d178695d03192
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-10-17 13:49:47 +00:00
Tor Arne Vestbø
92d67b58b8 macOS: Defer update request on drawRect: when a real expose event is needed
The semantics of QWindow::requestUpdate() is that it's used when the
window needs updates outside of the normal window invalidation callbacks
such as expose and resize events, e.g. when doing animations.

As a result, user code might not be prepared to handle window
invalidations in the update-request callback, assuming those
will still be delivered as normal, so that's what we do.

This was exposed by resizing one of the simpler Qt Quick examples,
where the resize's expose event was delivered as an update request,
but didn't trigger an unconditional draw of the window as it should,
as the scenegraph didn't change in response to the resize, which is
typical for an update request.

Change-Id: Ida8f85f1cf61c332aa9b199520e6854c48d3ab40
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-17 13:44:26 +00:00
Mårten Nordheim
b16add0dc6 QNetworkReply: Reduce noise and a fail when building with no-ssl
A few tests would QSKIP depending on the inclusion of SSL, producing
multiple lines of noise in the output.

And one test used https in one of its configurations without checking to
see if it could, causing an UnknownProtocolError.

Change-Id: I5f54bf1005f962cc027c099b816fbe245dc43d3f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 13:05:56 +00:00
Friedemann Kleint
127483b5e3 Windows QPA: Fix reporting of TabletLeaveProximity events
Move the check for totalPacks below; it prevents leave notifications
from being handled.

Task-number: QTBUG-53628
Change-Id: I2436c51308803337e6d48ef958e03123283d4a1d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-17 12:45:11 +00:00
Gabriel de Dietrich
198225983d QShortcut: Fall back to cross platform code in absence of QPA menu
On macOS, absence of a QPA menu means that we should be using our
own internal logic since there's no entity on the QCocoaMenuDelegate
to take care of the shortcuts.

Change-Id: I35ed8f0b55445f61d0528709d4debb636a502002
Task-number: QTBUG-61039
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-17 02:34:35 +00:00
Liang Qi
01afc8c810 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
2017-10-16 22:21:52 +03:00
Tor Arne Vestbø
ac35f9c44c macOS: Mark the widget's container as embedded when placed into NSMenuItem
Otherwise we'll end up creating a NSPanel for the QMacNativeWidget which is
never closed, even if the backing NSView is moved to a new superview.

Ideally this would be based on [NSView viewDidMoveToSuperview] and
[NSView viewDidMoveToWindow], with retain/releases of the corresponding
NSWindow, but that needs more research, especially as AppKit on macOS
10.13 will always keep a strong reference to the NSWindow.

Task-number: QTBUG-63443
Change-Id: I9eec5ea871373d00dedf154600bf7005898cf37a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-16 17:22:21 +00:00
Tor Arne Vestbø
ed9340a926 macOS: Add support for non-window backed offscreen surfaces
The modern approach to offscreen rendering on macOS is via FBOs, which
means there's no reason to allocate an NSView and corresponding NSWindow
just for that. In the offscreen case the NSOpenGLContext has a nil-view.

Change-Id: I2d1d407069af4d5283e6f56fba83db8eaf694ac6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-10-16 17:22:17 +00:00