summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
...
| * Cocoa: Fix Open GL resolution in high-dpiGabriel de Dietrich2013-05-152-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | We permanently enable 'wantsBestResolutionOpenGLSurface' when creating an Open GL window/surface. We were enabling it once we would detect a high-dpi Cocoa backend, whitout ever turning it off. Leaving it 'on' on non-high-dpi displays should not change anything. Task-number: QTBUG-31000 Change-Id: I3d0c77f7b36f3c22dacd04a50fcc5a7d88af32c0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Fix breakage of tst_qquickwindow::grab(invisible)Andy Nichols2013-05-142-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | Instead of waiting for -drawRect to call -setView on the NSOpenGLContext, we go ahead and attempt to set the context as soon as possible. If it is indeed required that we call -drawRect first then will try to call -setView again during -drawRect with the new NSOpenGLContext. Change-Id: I33d9f2ba241b49e8cfa6c9156dd5bf5e4cc6b164 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Cocoa DND: respect QDropEvent::setDropAction()J-P Nurmi2013-05-131-2/+5
| | | | | | | | | | | | Task-number: QTBUG-31061 Change-Id: Id3275a0510bfa619a52d17cf48a3e48b3bae5354 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Ensure the hovered signal is emitted for the action and menu for CocoaAndy Shaw2013-05-131-0/+10
| | | | | | | | | | | | | | | | | | | | In the Cocoa platform plugin the hovered signal() was not being emitted for the corresponding QMenu. This now ensures it is emitted for the action itself and its QMenu. Task-number: QTBUG-30841 Change-Id: I3cfe634a71de7b55550e2561eb1c6a939536216d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Fix Invalid Drawable error for QGLWidget on MacAndy Nichols2013-05-102-1/+19
| | | | | | | | | | | | | | | | | | | | You are not supposed to call NSOpenGLContext -setView: for a view that has not yet called drawRect. We we attempted to do this, we would get the invalid drawable error, leading to QGLWidgets just drawing garbage. Task-number: QTBUG-28175 Change-Id: I47aef07b4676f2db8591f98fc1661f6f447bdef9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Revert "OSX: obey the Qt::WindowTransparentForInput flag"Gabriel de Dietrich2013-05-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 79e729e111dd799ddbe281aaddfbc0e1ec0e7bc0, which partially fixed QTBUG-30122 and will need to be reopened. On the Creator side, we think using the Qt::ToolTip flag is a bit unsafe since tooltips are supposed to have very limited interactivity. We would like to propose to use a similar pattern as in QComboBox instead. Task-number: QTBUG-30702 Change-Id: I245b7d8b16ac870564ea44f24f481ebfec8ca9a1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Cocoa: Add support for ForeignWindow window typeGabriel de Dietrich2013-05-082-2/+10
| | | | | | | | | | | | | | Necessary to make QWindow::fromWinId() work on Mac. Change-Id: I0dc3a1b0d63cff61d484693aee711dc54fea6b2f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Use [NSEvent characters] to retrieve the input character.Gatis Paeglis2013-05-201-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is how it was done in Qt 4. An issue with the current approach was that it did not consider modifiers when setting a Qt::Key_* value, which would assign the same Qt keycode for: a = a(65) Alt + a = ā(65) [here it should return a unicode value for 'ā'] This is inconsistent with the other platform plugins. Also in the combination with a dead keys it was returning nothing in the output. Task-number: QTBUG-29005 Change-Id: Ic28eb55b3a9798ecb6012cc2e3fb18589b8b0392 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Cyril Oblikov <munknex@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Improve Qt-in-namespace implementation in the Cocoa platform pluginRomain Perier2013-05-1614-65/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | Objective-C++ does not support namespaces. In order to make this work, we decorate each symbol with suffix using the macro QT_MANGLE_NAMESPACE. However, with such a technic each public symbol needs to be explicitly exported through this macro. The use of @compatibility_alias allows to define alias to use it automatically and transparently. Task-number: QTBUG-23946 Change-Id: Id521b8160bab126fda40a9d960277b1c04cc8b66 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Use [NSEvent keyCode] to retrieve a virtual key code.Gatis Paeglis2013-05-101-5/+2
| | | | | | | | | | | | | | | | No need to use old style Carbon Event Manager function when there is Cocoa [NSEvent keyCode] equivalent for retrieving virtual key code. Change-Id: I5cceb76fc662e42a46a17dc69131091a64ca6060 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Windows: Introduce QFileDialog::DontUseCustomDirectoryIconsSérgio Martins2013-05-092-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Folders can have a custom icon, set by the user. Some system folders also have one, for example c:\windows\fonts. This option allows you to disable this behavior, you'll get the folder directory icon. As a side-effect, you'll get a very big performance improvement on removable/network media: 2 seconds vs 60 seconds on a SDCard with 10000 folders. Change-Id: Id55ea628186e0a6523585ec7a4ff622d6f5da505 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Merge branch 'stable' into devSergio Ahumada2013-05-071-19/+10
|\| | | | | | | Change-Id: Ica003a10ede86914bbbb062a2dc277a2ce39a259
| * Cocoa: Port QCocoaTheme::fileIconPixmap() to CocoaGabriel de Dietrich2013-04-301-19/+10
| | | | | | | | | | | | Task-number: QTBUG-30907 Change-Id: Ie460db63413ab9c8e0fb5fb85af907e1c7f12759 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-04-2921-103/+448
|\| | | | | | | Change-Id: I2a54058b64ac69c78b4120fdaf09b96e025a4c6c
| * Don't crash on null QCoocaMenuItem.Morten Johan Sørvig2013-04-261-2/+4
| | | | | | | | | | Change-Id: Ia70f616983141134afe874b69a5957e31f6f5ed9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Fix ignoring close events on OSXJosh Faust2013-04-264-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | QNSWindowDelegate was not handling windowShouldClose, which is how you can tell Cocoa that your window should not close if the close button is pressed. This change moves the close handling from windowWillClose to windowShouldClose, and adds an optional "accepted" pointer to QWindowSystemInterface::handleCloseEvent so that QNSWindowDelegate can return a true/false value for whether the window should actually close Task-number: QTBUG-28965 Change-Id: I67c6296ad42cbeeb71413e05411467d4e558adb4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Don't use the SubWindow flag for windows embedded in foreign windowsShawn Rutledge2013-04-265-7/+30
| | | | | | | | | | | | | | | | | | Instead, add QCocoaWindow::setEmbeddedInForeignView which can be called via QPlatformNativeInterface::NativeResourceForIntegrationFunction Task-number: QTBUG-30805 Change-Id: I05861e80ca664ddb430216388cf0fec573a4d32b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Increase the loopLevel when activating menu items.Morten Johan Sørvig2013-04-262-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply 0293aff5c44202e5c62e229b74d8bd0bf9206185 from Qt 4. Without this, calls to deleteLater() may create delete later events with a loopLevel of 1. Those events will not be processed until QApplication::exec() returns. Add a QScopedLoopLevelCounter that increases the loopLevel for the duration of the activated() call. Task-number: QTBUG-30660 Change-Id: I7ab3bb3a53243691b8f7f64e025150e5cc7da2c8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Fix shortcut override for menusFrederik Gladhorn2013-04-263-9/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we use native Cocoa menus, we cannot rely on the normal shortcut handling. Shortcuts can be overridden by the currently focused object in Qt. In order to make that possible we need to send a QShortcutOverride event before accepting any key event. For menus the key event goes from the NSApp directly to the menu, so the shortcutOverride would not work. This is mostly an adaptation of the Qt 4 code. Task-number: QTBUG-30695 Change-Id: Icb4979309d2d6f9606eb9c8abc4130dc79926593 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Respect the hotspot when creating the cursor in CocoaAndy Shaw2013-04-251-7/+7
| | | | | | | | | | | | | | | | | | | | The hotspot was not taken from the QCursor so if one was set then it was reset to 0x0. Change-Id: Ie81f1c2ac15a16f10436738367e612c44dc42d38 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Improve text heuristic menu item syncing logicGabriel de Dietrich2013-04-256-13/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't try anything after the original syncing, particularly after changing the menu item's text. Also, don't try anything if the menu item cannot be linked up to a menubar (see QTBUG-30756). This latter point requires extra syncing after adding a menu in the menubar. Finally, to be able to find the menubar, we need to clean the code for moc's eyes. Task-number: QTBUG-30756 Task-number: QTBUG-30812 Change-Id: I88fad663f1c35d03a0cb167d1723d16f590918c0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Reflect menu hierarchy in QCocoaMenu* objectsGabriel de Dietrich2013-04-253-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QCocoaMenu is child of either a QCocoaMenuBar, a QCocoaMenuItem as a submenu, or nothing as a standalone menu. QCocoaMenuItem is child of its containing QCocoaMenu. The parent is set during insertion and cleared during removal. QMenu needs to be updated to avoid double deletion and leaking its own platform menu. Change-Id: Iadf60d8062d7466fa616f84f3761fe322fc9aa2e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Remove dead code in QCocoaMenu*Gabriel de Dietrich2013-04-253-22/+2
| | | | | | | | | | Change-Id: I56136594f073295ced645d06f657187a54e84384 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Fix disabled minimize button on main windowsGabriel de Dietrich2013-04-231-1/+1
| | | | | | | | | | | | | | | | Task-number: QTBUG-30775 Change-Id: Idec64f2cc6181e6889498171ead676d33c66e537 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Don't crash on a null window pointer.Morten Johan Sørvig2013-04-231-0/+3
| | | | | | | | | | | | | | Task-number: QTBUG-30731 Change-Id: Id256b915012b43d1eb85bba62cbc1d42cfb58b34 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Cocoa: Add setAlertState(), isAlertState(), beep() functionsGabriel de Dietrich2013-04-234-0/+30
| | | | | | | | | | | | | | | | Also, fix operator precedence error in QApplication::alert(). Change-Id: I140ccfba29638d24bc1c97f5f9a9611f66eb6b8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Move Mac translations to .cpp file for lupdate to pick them up.Friedemann Kleint2013-04-235-39/+170
| | | | | | | | | | | | | | | | Task-number: QTBUG-30125 Change-Id: I4e56fd3021b4ef5f344d4d36ae594dd88e2aa1bd Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Return GroupRole for unknown accessibility roles.Morten Johan Sørvig2013-04-231-2/+5
| | | | | | | | | | | | | | | | | | UnknownRole draws attention from the screen reader and makes it focus on the unknown item. GroupRole is ignored and passes focus to child items. Change-Id: If7b4cd9ec02b1890929a709b84d897f452c39587 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * Accessibility Mac: Implement accessibilityFocusedUIElementFrederik Gladhorn2013-04-221-0/+18
| | | | | | | | | | | | Change-Id: I17b5b1f741a8b340d8f4b16f4ec39cc9a8159bfa Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * Revert "Don't warn on 0x0 sized windows."Morten Johan Sørvig2013-04-221-1/+1
| | | | | | | | | | | | | | | | This reverts commit 88272d6c04f0f67fa9612dc7bdb2a5f8ba8d0314, which accidentally re-introduced a crash. Change-Id: Ie60bcf55f940b24f982eed4f20c6af3320b040a7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-04-2618-49/+141
|\| | | | | | | refs/staging/dev
| * Convert the CGImage into a QPixmap after reading from clipboardAndy Shaw2013-04-221-4/+2
| | | | | | | | | | | | | | | | Now that the relevant function is available we can do the conversion inside QMacPasteboardMimeTiff when obtaining an image from the clipboard Change-Id: Ie41b0fffedf4dd3f8ef49431482bd075a69722b1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Disable QTBUG-30266 hack in full screenGabriel de Dietrich2013-04-191-1/+10
| | | | | | | | | | | | | | | | | | That would set the full screen window in a weird state, where is was full screen (but unable to exit that mode) and showing the title bar at the same time. Change-Id: I3ac913876f3b326504dd5af18c34181d002509d0 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Let platform plugin decide if accessibility is activeFrederik Gladhorn2013-04-193-12/+13
| | | | | | | | | | Change-Id: I881a8ff3fedf3db73ee37046a4363c70960a92a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * Make password mask characters themeable.Mitch Curtis2013-04-191-0/+2
| | | | | | | | | | | | | | | | Task-number: QTBUG-29871 Change-Id: I3cf739a321d7917f8f8431992e29bba0871b1934 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * Remove nativeResourceForWindow warning.Morten Johan Sørvig2013-04-181-3/+1
| | | | | | | | | | | | | | | | | | | | The warning is useful for pointing out the the return value will be null. However, code that correctly checks the return value (such as qt_macWindowIsTextured), still causes the warning to be printed. Change-Id: I3828992b3d5e7b08451cf0e051b937fa9d9536d3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * Mac: Fix various memory leaksGabriel de Dietrich2013-04-183-5/+7
| | | | | | | | | | Change-Id: Id554be11ffcf9a506c217b0dc5b96cb37c4dd57c Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa Menu: Remove unnecessary retain, release/retain in the right orderGabriel de Dietrich2013-04-181-5/+2
| | | | | | | | | | | | | | Also, make sure platform menu item is deleted on ActionRemoved event. Change-Id: Ic07a81cb77833bdffd1464abf1c81ebdee4d16e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Correct dir entries caching in QFileDialogCyril Oblikov2013-04-171-10/+32
| | | | | | | | | | | | | | | | | | | | Using QFileSystemWatcher to update cache when directory is changed. It is needed to correctly filter files created after the dialog opening. Task-number: QTBUG-30604 Change-Id: I5479f9a54095de59ca2ba36b2bd4906de0907ac8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Fix menu popup, againGabriel de Dietrich2013-04-161-28/+38
| | | | | | | | | | | | | | | | This time, popUpContextMenu:withEvent:forView: wouldn't respect the menu's minimum width setting. Change-Id: I7731851f2cf45d596d45a24dab5abe7b9239f07f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Make sure no invisible proxy icon button is createdGabriel de Dietrich2013-04-161-0/+2
| | | | | | | | | | | | | | | | If the icon is null, don't force creation. Task-number: QTBUG-30064 Change-Id: If639714f667fedfcc67a3393a7d75111a7dbff3f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Accessibility Mac: Enable ignoring of childrenFrederik Gladhorn2013-04-162-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The ignored children do not show up in the hierarchy, this should improve performance significantly. Previously the code would ignore the grouping property which seems to break QGroupBox. Change-Id: I4535af9c95bce76ded65f6d40fe07f17f3acffad Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Add autorelease pool for cocoa plugin creation.Morten Johan Sorvig2013-04-151-0/+3
| | | | | | | | | | | | | | Prevents mem leaks at startup on 10.6. Change-Id: I5f8b72c54ab396ee0ec2e47320163a6a342b78f1 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Add autorelease pools needed by Qt Creator.Morten Johan Sørvig2013-04-152-0/+4
| | | | | | | | | | | | | | | | With these Qt Creator startup is now warning-free on 10.6. Change-Id: Ie29d360611c0e516258920163e4e94d174217299 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Cocoa: Fix unresponsive main window after running more than one modal sessionGabriel de Dietrich2013-04-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, we postpone clearing the stack of modal sessions until we call processPostedEvents() again. However, it also means that when we clear the second modal session, that session keeps running although we just closed its window. The reason why it isn't stopped is because it wasn't the topmost modal session in the stack. This patch fixes the issue by stopping a modal session if any session above in the stack has been stopped. This makes it less problematic if we don't call processPostedEvents() in between ending modal sessions. Task-number: QTBUG-30504 Change-Id: I9f898250ae629947d066647f9d5a0b9f75cf0070 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| * Don't warn on 0x0 sized windows.Morten Johan Sørvig2013-04-151-1/+1
| | | | | | | | | | | | | | | | I don't think this is an user error. If it is then the warning should be in a cross-platform code path. Change-Id: I4c615d9b2372660bb03b17ccb25204b2a8d17b1a Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Cocoa: Fix popup menus on modal windowsGabriel de Dietrich2013-04-151-3/+33
| | | | | | | | | | | | | | | | | | Previously, we used -popUpMenuPositioningItem:atLocation:inView: but this turns out not to work with modal windows. This can actually be reproduced in Cocoa. Change-Id: I9b750d1f97637f0cc30329d3da3acf5200f62206 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Cocoa: Create QCocoaWindow when enabling touch.Morten Johan Sørvig2013-04-151-0/+5
| | | | | | | | | | | | | | | | The ref-counting and (native) touch enabling is implemented in QCocoaWindow. Change-Id: I4f3f5e16db59afec7dd7dd2f8360dd60b90bfe6d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Cocoa: Enable touch on 0->1 counter transition.Morten Johan Sørvig2013-04-151-1/+1
| | | | | | | | | | Change-Id: I9d8fb84851a866c3020cbbca13d5b2dc297cfe65 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Add devicePixelRatio metric to QPaintDevice.Morten Johan Sørvig2013-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPainter computed the devicePixelRatio based on the physical and logical dpi, and expected that the ratio between them would be either 1x or 2x. This was problematic for paint devices like printers where the physical dpi can be much higher than the logical dpi, and also for QScreen where the physical dpi would have to be defined as a multiple of the logical dpi. Add QPaintDevice::PdmDevicePixelRatio and QPaintDevice:: devicePixelRatio() getter and implement it for the QPaintDevice subclasses. Use it when calculating the highdpi scale transform in qpainter.cpp and when scaling the clip rect in qwidget.cpp. Remove physical dpi scaling for QImage, QPixmap and QOpenGLPaintDevice, reverting to the old behavior. Change-Id: I6c97510613196d4536ff39d08e9750b8782283d4 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>