summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-251-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qcoregraphics.mm src/gui/painting/qcoregraphics_p.h src/plugins/platforms/cocoa/qcocoahelpers.h src/plugins/platforms/cocoa/qcocoahelpers.mm Change-Id: Ibe5efcae73526b3d3931ed22730b13d372dcf54e
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-253-4/+7
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf src/corelib/tools/qdatetimeparser_p.h Change-Id: I5382cee3ddb33107dc61ee20f7a9188c4a68a882
| | * If there are no available sizes, then fallback to the requested sizeAndy Shaw2016-11-233-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a case like the SVG iconengine there is no available sizes implementation. However in that case we don't need to provide different sizes as we can have SVG scale it for us to the one requested. So it is assumed that with no available sizes implementation that the icon engine will take care of this for us. This ensures that SVG files can be used as icons inside the menu on macOS. Task-number: QTBUG-40225 Task-number: QTBUG-55932 Change-Id: If01ca582c4c07834e6de16652924e0b7e118c87c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Document third-party code in Cocoa QPA pluginKai Koehne2016-11-252-0/+42
| | | | | | | | | | | | | | | Change-Id: I2c30f5da25c83d6129403cb9b745a2f17fd6fd9e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | QCocoaMenu: Force NSMenuValidation when syncing itemsGabriel de Dietrich2016-11-161-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a menu item's enabled state changes after -[QCocoaMenuDelegate menuWillOpen:] is invoked, i.e., during or after QMenu::aboutToShow() is emitted, that state change may not be taken into account. This is because the automatic menu validation, upon which Qt relies, is not made aware of any such change. By calling -[NSMenu update] when syncing the QPA menu item, we induce Cocoa to invoke -[QCocoaMenuDelegate validateMenuItem:] and ensure that previously synced items, whose state may have changed, will be properly updated. This, however, has a small side effect, namely that menu-holding items will also go through the automatic menu enabling path and may appear disabled since, until now, they were not properly configured. In order to solve this, we set the action on those items as well, and make sure that both of QCocoaMenuDelegate's relevant methods, validateMenuItem: and itemFired:, properly process menu-holding items. Menurama manual test updated accordingly. Change-Id: I62f955538b8be09b8494ea0ce87fca7910148d38 Task-number: QTBUG-56850 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8Liang Qi2016-11-1612-41/+92
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-1612-41/+92
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-1512-41/+92
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | | * Cocoa: Make dictation via speech recognition workMorten Johan Sørvig2016-11-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning NSNotFound from the NSTextInputClient selectedRange implementation when there is no selection prevents dictation from activating (for unknown reasons). Return an empty {0, 0} range instead. Text input methods such as Pinyin still work after this change. [ChangeLog][macOS] Speech to text dictation now works for Qt text input. Change-Id: Ibf1729bdd271e8ed5ce3c9d2a0373c8ab3613d8e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Cocoa: Make child window cursors work correctlyMorten Johan Sørvig2016-11-085-38/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing cursor logic had a couple of issues: - It made the faulty assumption that we could not use the NSWindow invalidateCursorRectsForView API for child NSViews. - It used NSWindow invalidateCursorRectsForView and NSView resetCursorRects. This API has been replaced by the more general NSTrackingArea API. - It did not implement falling back to the parent window cursor if the current window has no cursor set. Document that QWindow cursors work the same way as QWidget cursors in that a QWindow with no set cursor will fall back to the parent window cursor. Change the cocoa platform code to use NSTrackingArea exclusively and implement NSView cursorUpdate which sets the cursor. Handle immediate change on QWindow:: setCursor() manually. Add QWindow::effectiveWindowCursor() and applyEffectiveWindowCursor() which finds the correct window cursor. Add a manual test for the child window, child widget, and QWidget::createWindowChild cases. Task-number: QTBUG-33479 Task-number: QTBUG-52023 Change-Id: I0370e11bbadb2da95e8632e61be6228ec2cd5e9d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * macOS: Clear event dispatcher interrupt stateGabriel de Dietrich2016-11-087-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pending interrupt of a QEventLoop may interfere with native runModal calls, resulting in Cocoa's main event loop to be stopped unexpectedly. After commit 9ab60b9c processEvents() no longer resets the event dispatcher interrupt flag. Add QCocoaEventDispatcher::clearCurrentThreadCocoa EventDispatcherInterruptFlag(). Use it to clear the interrupt state before calling runModal and variants. Work around the inability to use platform API in the print support code. Change-Id: I52f26f99a63cbb46969db42f65b09a3c3119ad15 Task-number: QTBUG-56746 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | | Cocoa Dialog Helpers: Refactor OK-Cancel buttons viewGabriel de Dietrich2016-11-164-219/+163
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since virtually all the logic is shared between QNSColorPanelDelegate and QNSFontPanelDelegate, we extract the added buttons and layouting logic and move it into its own class. This requires the two afore mentioned Objective C classes to satisfy the QNSPanelDelegate protocol. Change-Id: Ie26e758f5db71920896d930a4f3644b51a1ce3fa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-019-8/+51
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-312-2/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/minimalegl/qminimaleglintegration.cpp Change-Id: Ia6ab42a6daadbf8abc085c971545904d49ea4b56
| | * QNSColorPanelDelegate: Don't restore stolen view on deallocGabriel de Dietrich2016-10-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We may not be playing nice with Cocoa's internals when we decide to reparent NSColorPanel's contents to add QColorDialog's own OK/Cancel buttons. In order to reduce issues, we should avoid poking at things during the application's shutdown sequence. Simply releasing the stolen view should be enough at that point. A similar pattern exists in QNSFontPanelDelegate. Change-Id: I678c236e0c57c4d08a1109a479d965f924288c54 Task-number: QTBUG-56448 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-272-1/+28
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h src/plugins/platforms/ios/qiosintegration.h src/widgets/widgets/qcombobox.cpp tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
| | * QCocoaMenuBar: Update even if no window is attachedGabriel de Dietrich2016-10-242-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Then we need to check if the current active (or focused) window has any menubar associated. In case there isn't, and the menubar has no window associated, then we should update immediately. The previous condition is still valid. Change-Id: I4532ccc87354d91c76b53f5433dc3944b9e29584 Task-number: QTBUG-56275 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * | Cocoa integration - remove erroneous warningTimur Pocheptsov2016-10-241-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conditional statement checks/allows only right/left mouse buttons in handleMouseDraggedEvent and generates a lot of useless/misleading warnings in case we press (for example) a middle mouse button (when we're also moving mouse cursor, intentionally or not). Task-number: QTBUG-54160 Task-number: QTBUG-42846 Change-Id: I5c54b6204cb90036c7d98724537f1c985b40d9cc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-224-1/+20
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/qeglfshooks.cpp Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
| | * macOS: Only show menu and allow dragging on proxy when a file path is setAndy Shaw2016-10-194-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | If there is no file path set then it should not be possible to see a menu or to drag from a proxy icon in the titlebar. Task-number: QTBUG-56082 Change-Id: Ib8305bcab5717bc8cb7ddabbb079f152debbdded Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | port to modularized platformsupport librariesOswald Buddenhagen2016-10-158-9/+12
| | | | | | | | | | | | | | | Change-Id: I20eb0e33abfd70b6a5240e7b6b0aa0425f2d2ee7 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | macOS: Remove workaround for including AppKit.h with slots definedTor Arne Vestbø2016-10-135-40/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The workaround doesn't seem to be needed anymore, and wasn't applied uniformly anyways. If it turns out AppKit still needs this workaround we should add CONFIG += no_keywords to cocoa.pro, instead of trying to wrap every single include of AppKit in a undef slots dance. Change-Id: Ia1b15137c03abcc92f0dd246796622772e99ca68 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Remove QNSView member m_window in favor of going via m_platformWindowTor Arne Vestbø2016-10-134-75/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two should never be out of sync, but by having them as separate members we risk that they do. By going though m_platformWindow for QWindow access, it's also more clear in the callsites that we're dealing with a QWindow instead of a NSWindow, as referenced though self.window. Finally, removing the member slims down memory use of a QNSView, however small. Change-Id: Iec96cebf813fae82d3af339331781419f234c28b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Use QPointer to track QNSView -> QCocoaWindowTor Arne Vestbø2016-10-133-15/+1
| | | | | | | | | | | | | | | Change-Id: I4de581dda03d25e781112eff34de28dfd1797a7f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-111-9/+7
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpixmap.cpp src/widgets/kernel/qformlayout.cpp Change-Id: I8a8391a202adf7f18464a22ddf0a6c4974eab692
| * | Revert "QCocoaKeyMapper - correctly update key layouts"Timur Pocheptsov2016-10-101-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 26961e32f34c06f083fe441c23be6874f03446a3. This patch was apparently a bit ill-considered and while fixed one problem introduced others. Task-number: QTBUG-50865 Change-Id: I2e3569d16c8fc47b4a492d4aed6e747d7ff93a55 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Get rid of m_qtView member in QCocoaWindow that aliased m_viewTor Arne Vestbø2016-10-109-49/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The member was mirroring m_view in all cases except for foreign windows. Instead of a member we now check window()->type() != Qt::ForeignWindow, which is more explicit, especially for people not normally working on the macOS platform. To call methods that are only implemented for our QNSView subclass, a new qnsview_cast() function has been introduced. Change-Id: I0a2cfe1a5e4502250c17e1c3ebdce19e9ee5e572 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-062-4/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_pre.prf mkspecs/features/qpa/genericunixfontdatabase.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf src/corelib/io/qiodevice.cpp Change-Id: I6f210f71f177a3c3278a4f380542195e14e4b491
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-051-1/+1
| |\| | | | | | | | | | Change-Id: I34b5e290233d0869fbafac094a939aec2bf83fd5
| | * QCocoaEventDispatcher: Save interrupt state between embedded callsGabriel de Dietrich2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since QCocoaEventDispatcher::processEvents() resets the interrupt state, this may prevent a higher level event loop from returning. For example, calling QMenu::exec() and, as a result of an action being triggered, the application calls QCoreApplication::processEvents() after QMenu::hideEvent(). In this case, the menu event loop can be stuck until we run another event loop. Task-number: QTBUG-53947 Change-Id: If7efe1c3c07f7222c695195cbb4f41715e49b02e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | Cocoa: Don’t send tablet events as mouse eventsMorten Johan Sørvig2016-10-031-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-apply change 6e850af09dd595b3b0e87135a1e68755c35f8964, the code for which has gone missing. This prevents sending tablet events as both mouse and tablet events, which confuses the double-click detection code in QGuiApplication::processMouseEvent() when tablet->mouse event synthesis is enabled. Task-number: QTBUG-54399 Task-number: QTBUG-51617 Task-number: QTBUG-47007 Change-Id: I6183906d4ce2b8cdc617d34e22a9dcf999eef51d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Replace QCFString::to(CF/NS/Q)String usage with QString methodsTor Arne Vestbø2016-10-0619-81/+81
| | | | | | | | | | | | | | | | | | | | | | | | Slims down QCFString and leaves only one implementation of converting back and forth between CF/NS strings and QStrings. Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Implement QMacCocoaViewContainer in terms of foreign windowTor Arne Vestbø2016-10-054-33/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This leaves a clearer separation between the foreign-window and non-foreign window use-cases, where a single QCococaWindow can only be in one mode, which is determined in the constructor and doesn't change after that. There are no source or binary compatibility guarantees for the QPA classes, meaning the helper function in QPlatformNativeInterface can be removed. Change-Id: I3232aedca1d98c49a8f54e16750832187f9dc69a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Rename m_contentView to m_view, to distinguish from [NSWindow ↵Tor Arne Vestbø2016-10-056-75/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contentView] The contentView is the root view of a NSWindow, but our m_contentView is just the corresponding NSView of a QWindow, and doesn't always match the contentView property of the NSWindow. This is part of a multi part cleanup to the Cocoa platform plugin in preparation for improved foreign-window support. Change-Id: Ifaffb12f35544ec05e4a83964b346b47fa4b0576 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Fix PrintScreen mapping on macOS and moreAllan Sandfeld Jensen2016-10-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the mapping of the rare multimedia Print key, adds the real mapping of the Print Screen key. Also adds a mapping for few other short-cut keys that were added in 5.6 Change-Id: I931bf1eed062536e1be2aa6aa6f19d773bb5ec55 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | | Remove QCocoaWindowPointer in favor of QCocoaWindow inheriting QObjectTor Arne Vestbø2016-10-012-54/+19
| | | | | | | | | | | | | | | | | | | | | | | | As already done by the iOS, Mir, and Haiku platform plugins. Change-Id: I449f396dbf234e27206625b178c7d20e3f5b956f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-292-11/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/uikit/xcodebuild.mk tests/auto/other/lancelot/tst_lancelot.cpp tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Change-Id: Ia0ae2de86094120281abd445138877c2cc3e882c
| * | Cocoa: Get mouse position from the eventMorten Johan Sørvig2016-09-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want the coordinates for a mouse event to be the position at the time of event generation, not the current position. This is a followup to 39be577c which fixed this for some cases. This commit replaces all usages of [NSEvent mouseLocation] with code that gets the location from the event. Change-Id: I691a46a61ce65e2b33335453b5b22de01f76d767 Task-id: QTBUG-54399 Task-id: QTBUG-37926 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | QGuiApplication, platform plugins: don't modify AA_DontUseNativeMenuBarShawn Rutledge2016-09-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default should be false, meaning the application will prefer to use a native menubar if the platform supports it. The application author can set it to true if he wants to always use a Qt-rendered menubar instead; or, he can call QMenuBar::setNativeMenuBar(). Qt and its plugins should not override the author's wishes. Instead, if the platform plugin cannot create a native menubar for whatever reason, createPlatformMenuBar() will return null, and QMenuBar will fall back to using a Qt menubar instead. The application can check the result via QMenuBar::isNativeMenuBar(). QMdiArea when maximized inside a QMainWindow with an empty title does not replace the main window's title if we are using native menus. This behavior turned out to be the same on Unity as it is on macOS, so the autotest needed adjustment to expect that behavior whenever the menubar is native, not only on certain platforms. tst_QMenuBar::allowActiveAndDisabled() tests a standalone QMenuBar. In f92f78094 it was disabled on macOS, but on Ubuntu it passes as long as we force it to be a non-native menubar, so it should pass that way on macOS too. Removed unused variable RESET to fix warning. Task-number: QTBUG-54793 Change-Id: I716e40da709f96331cbbf25213bd7bc153e4dbe2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Cocoa: Add drawBackingStoreUsingCoreGraphicsMorten Johan Sørvig2016-09-222-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drawRect is a general “repaint now” function, which we should handle also for OpenGL content. Make that clearer by moving the implementation details of drawing the raster backing store using CoreGraphics to a separate function. Behavior change: Call invalidateWindowShadowIfNeeded also for the OpenGL case. Change-Id: I158ebef548e063f826db2dc708c14ab1d784b095 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-221-0/+5
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/qiosviewcontroller.mm Change-Id: I2dda31867cbc79ea7fe965f52afb518aefa4ad20
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-211-0/+5
| |\| | | | | | | | | | Change-Id: I9cfefaf22b010fca937be77979f5fb50574bb71e
| | * Update swap interval of QCocoaGLContext after creationTor Arne Vestbø2016-09-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | QSurfaceFormat is recreated from scratch, and by not reading back the swap interval the QCocoaGLContext seemed to be vsynced even if it actually was not. Change-Id: I72ddaae9a4c695fe4c74d7b4b70ca9db84bcc084 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | macOS: Implement QCocoaBackingStore in terms of QRasterBackingStoreTor Arne Vestbø2016-09-183-79/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | The previous detection of device pixel ratio changes in paintDevice() is not needed, as QBackingStore::beginPaint() already does this check and calls resize(). Change-Id: I9ee8410fa3a5404c5ec19d2cba4543a9e3359fe9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | macOS: Move QColor/QBrush conversion functions to QtGuiTor Arne Vestbø2016-09-182-132/+0
| | | | | | | | | | | | | | | Change-Id: I971d1d69b491532fd0dc0bab72b274dec6591e6b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | macOS: Move image conversion functions to QtGuiTor Arne Vestbø2016-09-1811-140/+10
| | | | | | | | | | | | | | | Change-Id: I911f2648e506f27519e98be1bffe2c5ab0f388f1 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | macOS: Remove unused function qt_mac_QRegionToHIMutableShapeTor Arne Vestbø2016-09-182-13/+0
| | | | | | | | | | | | | | | | | | | | | Code using it was removed in a198ce8d. Change-Id: I841f55768da080fbc87e0f2d9394cdc0a22e500e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | macOS: Move QMacCGContext helper into QtGuiTor Arne Vestbø2016-09-177-265/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation was duplicated and spread out between QMacStyle, QMacPaintEngine, and the Cocoa platform plugin. Moving it into QtGui allows using it on other Apple platform. Change-Id: Iadcbd71998204887e116271c575037789b6e2163 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-051-1/+9
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: I03b92b6b89ecc5a8db7c95f04ebb92ed198098a8
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-051-1/+9
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/testlib/selftests/generate_expected_output.py Change-Id: If856162abf9a24ae2c9946d336a7d1da03520fa7