Commit Graph

35947 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
100ebf1c97 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-04-20 20:06:18 +00:00
Qt Forward Merge Bot
6f45fda50b Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I0bea38585382b5d9c8d7a013bf6bcb3a6008d159
2018-04-20 21:22:53 +02:00
Gabriel de Dietrich
f35f282c4f Cocoa Helpers: Add qt_objc_cast() function
This generalizes what qnsview_cast() does to any Objective-C class.

Notice that this is a loose cast, using isKindOfClass: instead
of isMemberOfClass:.

Change-Id: I745f548e474f2f9eef89f370d7d45496f0c51434
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-20 17:45:23 +00:00
Tor Arne Vestbø
2b40af7177 tst_qimagereader: Make sure to include all image resources in test
The manually maintained qrc file was missing corrupt_clut.bmp among
others.

Change-Id: I8916ba76a63950de03f25814d893306d046d273d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-20 15:05:01 +00:00
Anton Kudryavtsev
ab6cc41968 QTabWidget: clarify ownership after insertTab() and addTab()
Change-Id: I7cd3aa5c092c99bbafd09c4bea7c6824d0b6740a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-20 10:40:37 +00:00
Mirko Vogt
a8f73a1624 configure: mention -libudev in help output
amends 684a1559f.

Change-Id: I25fd5f096e99937382048e2eb763715b9578a8fb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-20 10:38:03 +00:00
Andy Shaw
7c532891e0 Send ShortcutOverride event when receiving a non-spontaneous key press
When a key press is received which is not spontaneous then it needs to
be manually sent as a shortcut override event to ensure that any
matching shortcut is triggered first. This enables emulation/playback
of recorded events to still have the same effect.

[ChangeLog][QtWidgets] Sending a key press event with sendEvent() now
sends a ShortCutOverride event first to the widget to trigger any
shortcuts set first.

Task-number: QTBUG-48325
Change-Id: Iafcc2cdb1773bffe89edaeb0abc44cd5a51088e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-20 10:18:49 +00:00
Gabriel de Dietrich
7ee44dcb9c Cocoa QPA: Clean up 0 as pointer
We use nil for Objective-C null pointers and nullptr everywhere
else, including CoreFoundation and similar opaque types.

Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-19 22:20:12 +00:00
Gabriel de Dietrich
48defe41e1 Cocoa Menus: Allow separators in app menu
We extend QCocoaNSMenuItem with separator items capabilities
and use it as any other custom item in the app menu.

Addition and removal of items in the app menu remains very
basic because that menu doesn't exist as such. Instead, it's
hinted through the QAction's menu role.

Change-Id: Ia13bfcc008c75e49fd21705d2528da5a85ed1c73
Task-number: QTBUG-63756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-19 22:20:05 +00:00
Gabriel de Dietrich
99290faa66 QCocoaMenuLoader: Add app specific items after Preferences
This is in accordance with the macOS HIG which state that, "in general,
a Preferences menu item should be the first app-specific menu item." See
https://developer.apple.com/macos/human-interface-guidelines/menus/menu-bar-menus/

Change-Id: Ie2b6ce274995a7d0b0e934c6a68241500a39f7aa
Task-number: QTBUG-63756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-19 22:19:59 +00:00
Gabriel de Dietrich
b7be91b5f2 Cocoa Menus: Use the responder chain for menu items target/action
We start by setting the menu item target to nil.

Then, -[qt_itemFired:] action is now in QNSView, which itself is
naturally inserted in the responder chain. This removes the need
to track and change the menu item's target/action when we're
displaying a native dialog. Part of this is possible because we
now derive our own QCocoaNSMenuItem class from NSMenuItem.

We use -[respondsToSelector:] to decide whether the QNSView in
the responder chain should respond to cut:, copy:, etc. And we
only return YES when the view is first responder. The invocation
to these action is forwarded to the same views' -[qt_itemFired:].

Message forwarding is done via forwardInvocation:, but experiments
have shown that it can be done by the sole means of respondsToSelector:
and direct invocation from cut:, copy:, etc. See the usage of the
macro QT_COCOA_DYNAMIC_MENU_ITEM_ACTION.

Menu validation also happens in QNSView and looks for modal windows.
Therefore, -[worksWhenModal] is no longer necessary. Also, since the
target is no longer set, the logic as documented in NSMenuItem.target
won't work anymore.

Most items from QCocoaMenuLoader also become QCocoaNSMenuItem and
get the same target/action, which removes a bit of duplicated (and
outdated) code. A particular case is the Quit item, which gets the
terminate: action set until an actual menu item is added.

Tested with texedit and standard dialogs examples together with
menus, menurama and bigmenucreator manual tests.

We also renamed some functions and variables to reflect common
naming practices.

Change-Id: I9b51d3be3467a666d8c3dcf8585edbc821e0282e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-19 22:19:46 +00:00
Andre de la Rocha
0b9a301e89 Windows: Fix MDI child window titles in High-DPI displays
This change improves the appearance of MDI child windows in a High-DPI
display for applications using the WindowsVista style, with the
Qt::AA_EnableHighDpiScaling attribute set.

Task-number: QTBUG-64708
Change-Id: I5e9fbd23809b440ffd33e4948c83d115cc6e1910
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-19 18:39:28 +00:00
Paul Wicking
941db4e0bb Doc: Update QtConcurrent::mapped example snippet
Wrap current example code snippet in std::function as a work-around,
as suggested in comment to QTBUG-61145 (see history tab) with the same
issue.

Task-number: QTBUG-67603
Change-Id: I6875b31d8e983e234b88384c7d76917ac144f953
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-19 15:33:31 +00:00
Edward Welbourne
15ff5cfedd Prefer the raw data, if it specifies a locale, before shedding tags
QLocaleData::findLocaleData() was checking its given data with likely
tags filled in, but not checking it without; then it went on to blot
out some of the given data with Any, checking first with likely tags
then without.  The lack of this second step with the full data seemed
misguided.

Change-Id: I58ee09f5a2a3355446333fc9985a2fb818491e2f
Reviewed-by: Jason Erb (Suitable Technologies) <erb@suitabletech.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-19 14:19:37 +00:00
Edward Welbourne
8c80dad4b5 Unicode TR 35: add likely subtags in the specified order
The Likely Subtags section (4.3) of Unicode TR 35 stipulates a quite
specific order for trying the various candidate lookups; we had two of
them swapped and were missing the last.

Change-Id: Idcd8e7f7c9849be3ee805245e7746435e992c1db
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-19 14:19:25 +00:00
Jan Murawski
b0726e8641 Add HTTP caching headers to KnownHeaders
QNetworkRequest is already aware of the Last-Modified header but
has been lacking support for the If-Modified-Since, ETag, If-Match
and If-None-Match headers. These headers are used with HTTP to
signal conditional download requests.
See RFC 7232 for more information.

Change-Id: I248577b28e875fafd3e4c44fb31e8d712b6c14f1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-19 06:46:13 +00:00
Friedemann Kleint
370cd37cea Manual shortcut test: Arrange in QGridLayout
Change-Id: I93264bec8810f4dd1e2c010cc4dd35df93f31102
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 20:54:03 +00:00
Tim Uy
30874fb2df qmake: fix sdk resolution on macos
the 'info' variable was re-used too early. make a new one 'infoargs'
instead.

Task-number: QTBUG-67286
Change-Id: I77881ecbfce338d653358c5e5edac84e1c0c7de3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-18 19:10:19 +00:00
Andy Shaw
34e34f2209 iOS: Use the non deprecated application:openURL function
In iOS 9.0, the original application:openURL function was deprecated
and replaced with a newer one. As iOS 9.0 is no longer supported we can
safely switch to the new one. This is also required to prevent a crash
when the LSSupportsOpeningDocumentsInPlace and UIFileSharingEnabled keys
are set to true in the Info.plist file.

Change-Id: I59a7ee82e3ddb2777ef78e28b964ef8666c629af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-18 19:44:37 +00:00
Lars Schmertmann
c08197ccab QObject: Extend debug output of connect
Sometimes it is hard to find the line, when the warning
"QObject::connect: invalid null parameter" appears in the log.
This change adds the class names of the sender and receiver
to give a hint where to search for the wrong call to connect.

Change-Id: I00cead7d943f96d60f198cb3f0bed34ba10285c5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-04-18 17:57:30 +00:00
Gabriel de Dietrich
0dd2973761 QCocoaTheme: Include CoreServices rather than Carbon
And add CoreServices as framework dependency.

The standard pixmaps depend on CoreServices, or LaunchServices
to be accurate.

Change-Id: Ib97e521f3e950586a352bf9b30f827ce3fda8efd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-18 17:29:20 +00:00
Gabriel de Dietrich
84988886a5 QToolTip: Hide tooltip on key event on macOS
This brings back Qt 4 behavior. The difference is that we only
ignore modifier-only key events, as it's done natively.

Task-number: QTBUG-49462
Change-Id: I02f2313e1164ba185336d80ac5cc16ce6d883b79
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:40 +00:00
Gabriel de Dietrich
0c936d7411 QCocoaPlatformTheme: Fix tooltip background color
It use to be yellowish in the past, but modern versions
of macOS show it light gray.

Change-Id: I8cca5cbb37c73a6dfc79e633a746b9a7d7bced05
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:29 +00:00
Gabriel de Dietrich
e991fd4802 QMacStyle: Fix SC_ComboBoxEditField rect
Change-Id: I851e4bb1e0177ef5c594328c717e58ec7c9494e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:20 +00:00
Gabriel de Dietrich
85cb183488 QMacStyle: Fix appearance of selected inactive tab bar button
Because we use toggle NSButton for selected tabs, the inactive
appearance doesn't follow what NSSegmentedControl would have
shown. Therefore, we fall back to our good old habits, i.e.,
render on a pixmap and do some pixel transformations.

Change-Id: I838a2f23abee5846219ba67328c79fa8cc359a9b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:22:13 +00:00
Gabriel de Dietrich
48900145a4 QMacStyle: Clean up code, remove dead bits
Change QMacStylePrivate::drawNSViewInRect() signature
to remove all the unused parameters.

Reuse recent tab direction functions where appropriate.

Includes the infamous outter -> outer fix.

Change-Id: I8f92d79d8a6c3b5903bfbb13293afb6f72a5340b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-18 17:21:54 +00:00
Anton Kudryavtsev
a1e94c8b3b Accessible: use range-based for instead of foreach
Change-Id: Idb745f6a59d102f2f89b2cfa5177ec874d7599a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-18 15:32:26 +00:00
Timur Pocheptsov
46ad794a96 Auto-tests: remove unneeded 'gui' from QT variable
none of these tests needs anything GUI-related.

Change-Id: I6b3c02bf13da60ab460f0cc4d804f1d03bc68f50
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 14:22:26 +00:00
Timur Pocheptsov
9865ecf9db h2 auto test - replace QEventLoop (and QTimer) with QTestEventLoop
QTestEventLoop (conveniently so) takes care of timeouts thus no
external QTimer/handling logic needed at all.

Change-Id: Id65ea928daec1e7d9380107e63916896f19d3d14
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-18 14:18:38 +00:00
Jan Arve Saether
be4eaca053 Do not ignore MenuItem on macOS
The idea was probably to ignore it since macOS already provides
accessibility for a menu item in its native system menu. However, a Qt
Quick Controls2 Menu will instead show a non-native menu, which should
not be ignored.

Task-number: QTBUG-63522
Change-Id: Ib5ae16ad991ebd7a18fa73b8f576f20b1c14d4c8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-04-18 13:28:44 +00:00
Kari Oikarinen
c6ee1899ea Blacklist tst_QWindow::isActive on Ubuntu
Task-number: QTBUG-67768
Change-Id: Ie1e0b406c152c854ef3629fa4d469dd73452f128
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 13:23:18 +00:00
Andy Shaw
8caf9e6b18 iOS: Allow building QML based test cases
In order to be able to build and test a testcase on an iOS device it
needs to be a bundle. So the app_bundle config should only be removed if
the testcase_no_bundle is set. This is already done by testcase.prf.

Task-number: QTBUG-45211
Change-Id: I4f16ea832ccff2a5db5fed0050fa0344b4ac9ad6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-18 12:19:31 +00:00
Mitch Curtis
3520329937 Doc: link to QEnableSharedFromThis from QSharedPointer docs
Change-Id: I1c4a168c0581b6273b99a7ea8faa29114bda39e2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-04-18 11:42:40 +00:00
Tor Arne Vestbø
e0e1c7ec2d iOS: Trigger manual layout of root view controller when coming out of background
When rotating the device when the application is in the background iOS will
ask the root view controller to layout its views when then foregrounding the
application, but at that point the application state is still in the suspended
state, meaning we block any view resizing or rendering.

To ensure the views are resized correctly, we trigger a manual layout after
the application comes out of the suspended state.

Task-number: QTBUG-67719
Change-Id: I1ef0a4133d4b94edaac7b0f3cb4e49e367eb76d4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 11:32:11 +00:00
Tor Arne Vestbø
a75f25a43f Fix runtime platform detection on Apple platforms
The watchOS and tvOS platforms also define __IPHONE_OS_VERSION_MIN_REQUIRED
for compatibility, so we need account for that in the ordering of the ifdefs.

Task-number: QTBUG-67534
Change-Id: Id86e684137550533470370ef29c3563d677d5865
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-04-18 11:32:10 +00:00
Anton Kudryavtsev
3697366642 QSplitter: fix doc for widget() and handle()
Change-Id: I7b8a0ba9f6b99eae22c2230c761d7a14045256db
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-18 11:21:00 +00:00
Andy Shaw
99e52d89fe Compile when using -no-feature-networkinterface
Change-Id: I12a808599dd1fecaebc2e85a96da27a044666009
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-04-18 11:20:22 +00:00
Andy Shaw
9899c29daf Don't ignore the shortcut when the QMenuBar is parentless
With Cocoa it is possible to have a parentless QMenuBar so that the same
one can be used for multiple windows. Therefore if the top level window
is the QMenuBar when checking for the context then we can let it carry
on as if the top level window is the same as the active window.

Task-number: QTBUG-45453
Change-Id: Ifacf2111d5f9973afe8af30c6338918f130e51a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 11:20:09 +00:00
Andy Shaw
8e5f6e3bed Don't send a mouse move when we just need to do a synthetic enter/leave
[ChangeLog][QtWidgets] QApplication no longer sends a mouse move event
to the entered widget if it sends synthetic enter and leave events.

Task-number: QTBUG-67736
Change-Id: I75daaffd53f1ddc2bc4d7df67382cbc22d3eb6fc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 08:19:41 +00:00
Qt Forward Merge Bot
c8625a3e67 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I86f04fc3b2e4291f161a4985adddd6fd6c789d33
2018-04-18 01:00:28 +02:00
Andre de la Rocha
436faee8b3 WinRT: Add Windows UI Automation support
Adds support to accessibility tools and programmatic UI control to the
WinRT platform through Windows UI Automation, using the AutomationPeer API.

[ChangeLog][winrt][feature] Added support to Windows UI Automation to the
WinRT QPA, allowing Qt-based UWP applications to operate with accessibility
and programmatic UI control tools.

Change-Id: If0a8edbebc7c16c4896d749f2d7e11809b4b37b3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-17 17:36:48 +00:00
Timur Pocheptsov
c555c8b9f5 Add QSsl::Dtls1_0OrLater enumerator
... to make DTLS protocols work  more like TLS protocol versions.
Also, handle (as 'unsupported' for now) those new constants in
a switch statement, when creating SSL_CTX (fixing build errors).

Change-Id: Ia444184ca191d8665e37046b0b9120e43ec5893a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-17 17:10:12 +00:00
Edward Welbourne
3ac029f674 Make generated selftest output match for in-source builds
When generate_expected_output.py is run for an in-source build, the
raw output contains no paths to the sources for the script to whittle
down, as it does for shadow builds, to just the path from qtbase down.
So kludge together some extra regexes that can fix that up and tweak
some relevant code to provide them with the data they need.

Change-Id: I656d7126087bd9ad20b2af6835fba314d90a171d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-17 16:22:49 +00:00
Andy Shaw
0b70f5ada9 QDoubleValidator: Allow intermediate values as close as possible to one considered invalid
The documentation states that if you have a range of
0.00-2.00 with the number of decimals set to 2 then
any number up to 9.99 would be considered intermediate.
This is because the number of digits still matches both before
and after the decimal point. If it is 10.0 or 9.999 then
it is still considered invalid.

In the case of 9.999 being invalid in this case, the documentation
is corrected as this was incorrectly indicated as Intermediate,
as the code indicates it as Invalid.

Change-Id: I07b433e856f355916a1240deafdf4ef58e680639
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-04-17 15:36:34 +00:00
Tor Arne Vestbø
49b4433adf Provide QPlatformWindow::hasPendingUpdateRequest() helper function
So that platform plugins don't need to dive into QWindowPrivate.

Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-17 12:55:06 +00:00
Tor Arne Vestbø
8e2a970566 macOS: Add logging when delivering update requests
Change-Id: I2144e39c69fe79c0a31d5fb708abe4b20169d27a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-17 12:55:04 +00:00
Tor Arne Vestbø
ab9b026d27 iOS: Don't assume our UIWindow is a QUIWindow
Change-Id: I6494e4a476273b131aedcf409abdb1ffffa5b62e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-17 12:55:02 +00:00
Błażej Szczygieł
5b09346cf4 Widgets: Use accelerated scroll when scrolled widget is overlapped
Get region of overlapped widgets and scroll only non-overlapped parts
of image. Next, schedule an update for overlapped widgets region.

This patch improves scrolling performance when scrolled widget has
overlapped widgets.

Common use cases:
- faster scrolling when using "StyleHint::SH_ScrollBar_Transient",
- faster scrolling of zoomed image with semi-transparent thumbnail.

Accelerated scrolling with overlapped widgets is not available when
scale factor is non-integer.

Task-number: QTBUG-64504
Change-Id: I8337d3bc756e50f7d31cdc7979ccf86dc5c3695f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-04-17 06:32:52 +00:00
Kai Koehne
2b5587d901 Use placeholder for year in header.* files
It would be tedious to bump them every year, but we don't want
people to copy completely outdated year numbers either ...

Also consistently use https:// in contact address.

Change-Id: I9654417a3037fc18c6b9a0551c4883f5fc960084
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2018-04-16 11:02:22 +00:00
Kai Koehne
18ea6a6d3c Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt
Commit 71404b0be1 added new header templates and LICENSE.GPL2,
LICENSE.GPL3, LICENSE.GPL3-EXCEPT, LICENSE.LGPL3 files already in 2016.
So it's finally time to remove some of the old licnse files.

LICENSE.LGPLv21 and LGPL_EXCEPTION.txt is not referenced anywhere
anymore. LICENSE.GPLv3 is referenced only in LICENSE.LGPLv3.
We unfortunately still have to keep LICENSE.LPGLv3 because it is up
to this day used in the standard header templates, but we can just
change the reference in there to LICENSE.GPL3.

Change-Id: Ia88b4de8a395757a39ca63d474b2214e3b1063fb
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2018-04-16 11:02:14 +00:00