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>
The manually maintained qrc file was missing corrupt_clut.bmp among
others.
Change-Id: I8916ba76a63950de03f25814d893306d046d273d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
... 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>
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>
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>
So that platform plugins don't need to dive into QWindowPrivate.
Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
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>
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>