summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_mac.mm
Commit message (Collapse)AuthorAgeFilesLines
* To support QT_NO_IM on Linux/Windows/MacJing Bai2013-01-211-1/+4
| | | | | | | | | | Fix compilation issue when QT_NO_IM is defined. Also fixed references in tests. But fixing plugins/examples seem not necessary at this point. Task-number: QTBUG-26109 Change-Id: I2067051951616012117efa6716640cbf198fdb2a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Mangle QNSApplication into a namespace when Qt is configured as suchYan Shapochnik2012-10-151-1/+1
| | | | | | | | | | | | | | Ensure the correct QNSApplication is referenced when multiple Qt instances exist in a process. This will also prevent the following messages from being displayed in the console "Class QNSApplication is implemented in both /path/to/QtGui.framework/Versions/4/QtGui and /path/QtGuiNamespaced.framework/Versions/4/QtGuiNamespaced. One of the two will be used. Which one is undefined. Change-Id: I22e7f06aa35e9daecf2e9c881268baf92d35022c Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Ensure that QApplication is cleaned up after itself on MacAndy Shaw2012-09-121-0/+5
| | | | | | | | | | If the sendEvent function is replaced on the NSApplication, then QApplication should ensure that it undoes that if it is destroyed while the NSApplication is still running. Task-number: QTBUG-24248 Change-Id: I087ae575b7d670fa8dacfb80636d813c7bceb41d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Don't get stuck in a loop while trying to close the active popup widgetAndy Shaw2012-02-081-1/+1
| | | | | | | | | | | When the application is deactivated then it will try to close down the active popup widget. However, the popup widget can prevent a close from occuring and Qt should respect this without causing problems when the application is reactivated later on. Task-number: QTBUG-23448 Change-Id: Icc4902cbeac99eb631e569167227d9bcd4d4dcbb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add a QApplication::queryKeyboardModifiers() method.David Faure2011-08-171-0/+5
| | | | | | | | | | QApplication::keyboardModifiers returns the keyboard modifiers from the last keypress event in this process, as documented. However there are use cases for querying keyboard modifiers as they currently are, see QTBUG-11243. Merge-request: 585 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Merge remote-tracking branch 'origin/4.8'Olivier Goffart2011-06-241-2/+1
|\
| * Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qtDavid Boddie2011-06-171-0/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: doc/src/declarative/righttoleft.qdoc examples/draganddrop/fridgemagnets/main.cpp examples/script/context2d/main.cpp
| | * Merge remote branch 'qt/4.8' into fire-masterPaul Olav Tvete2011-06-061-17/+17
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/wayland/qwaylandclipboard.cpp src/plugins/platforms/wayland/qwaylandclipboard.h src/plugins/platforms/wayland/qwaylanddisplay.cpp src/s60installs/eabi/QtOpenGLu.def
| | * | Force repaint of modal sheet in Cocoa.Fabien Freling2011-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the raster engine on Mac OS X, modal sheets only get their content painted once the sliding down animation is over. By forcing the repaint, the modal sheet has the correct painting during the whole animation. Task-number: QTBUG-17426 Reviewed-by: Samuel Rødal
| * | | Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qtDavid Boddie2011-05-241-17/+17
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qrawfont.cpp src/gui/text/qtextlayout.cpp src/gui/util/qscroller.cpp src/gui/widgets/qlineedit.cpp
| * | | Doc: Fixed qdoc warnings.David Boddie2011-05-111-2/+0
| | |/ | |/|
* | | move some internal helper functions from qglobal.cpp to qcore_mac*Ritt Konstantin2011-06-091-1/+0
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | namely: void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding = 0, int len = -1); QString qt_mac_from_pascal_string(const Str255 pstr); OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref); OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec); remove relevant "extern" declarations all over the Qt sources Merge-request: 2615 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* | Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
|/ | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into ↵Richard Moe Gustavsen2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | alien-squached Conflicts: src/gui/kernel/qcocoasharedwindowmethods_mac_p.h src/gui/kernel/qcocoaview_mac.mm src/gui/kernel/qwidget_mac.mm
| * Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| | * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | | | | | Reviewed-by: Trust Me
* | | Alien implementation for the Cocoa portRichard Moe Gustavsen2011-01-171-64/+60
|/ / | | | | | | Give Alien on Cocoa a warm welcome.
* | Use correct font for menu item shortcutsJiang Jiang2010-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | We used to use kThemeMenuItemCmdKeyFont for drawing menu item shortcuts, however, Apple is using the same font for both menu item text and shortcuts, it's likely that kThemeMenuItemCmdKeyFont is no longer valid. Change it to kThemeMenuItemFont will make the font for shortcuts consistent with other Mac applications. Task-number: QTBUG-15230 Reviewed-by: Fabien Freling
* | Don't assign id<NSApplicationDelegate> to NSObject*, use id insteadTor Arne Vestbø2010-10-151-1/+1
| | | | | | | | Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-09-101-3/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt demos/declarative/snake/content/snake.js demos/declarative/snake/snake.qml doc/src/development/qmake-manual.qdoc src/corelib/plugin/plugin.pri src/gui/kernel/qapplication_win.cpp src/gui/kernel/qdesktopwidget_win.cpp src/gui/painting/qdrawhelper.cpp tests/auto/qdir/tst_qdir.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf
| * Ensure that OpenGL contexts are attached to an NSView before first paintTor Arne Vestbø2010-09-021-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attaching an OpenGL context to an NSView too soon will result in an error "invalid drawable" printed on the console. We used to guard against this by checking the visible property of the NSWindow, but this turned out to be too late, as we had already recived an initial paint event by then as part of showing the window. The visual result was a single frame of gray painted before the user's paint event code took effect. We solve this by hooking into setInitialFirstResponder on the NSWindow, which is called as part of making the window visible for the first time. At this point it's safe to attach the GL context to the NSView, so we iterate all the GLWidget children of the top level window and make sure the context is attached by sending a MacGLWindowChange event. The check in qt_mac_update_child_gl_widgets() for a top level window had to be removed for this approach to work, but should be okey as we're only iterating the children. Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com> Reviewed-by: Trond Kjernåsen <trond.kjernasen@nokia.com>
* | Mac: fix bic breakageRichard Moe Gustavsen2010-05-211-25/+10
| |
* | Cocoa: Add support for native application event filterRichard Moe Gustavsen2010-05-201-14/+28
|/ | | | | | | | Support for adding application wide filters were never implemented for the cocoa port because of NSApplication singleton issues. This patch removes that problem by using introspection if needed. And the patch also makes qt_cocoaPostMessage more reliable.
* Carbon: problems closing down native applicationsRichard Moe Gustavsen2010-04-071-19/+24
| | | | | | | | | | When Qt is used as a plugin, Qt always eats the quit event in the application event handler. This patch makes sure we let the event through in that case. And also that we don't catch the following quit apple event. The whole buisiness of quitting down the native application is not the responsibility of Qt when used as a plugin. Reviewed-by: prasanth
* Mac: scroll speed does not match native applicationsRichard Moe Gustavsen2010-03-111-2/+7
| | | | | | | | | | | | | | It turns out that we limit wheel scrolling on mac to an upper limit per event to one page. This behaviour is a bit strange in the first place, and on mac, it is just wrong. Besides, even when this limitation is removed, we still scroll a bit slower that native. The 'problem' is to come up with a good conversion from pixel scrolling to line based scrolling (Qt does not really have an API for pixel scrolling). But we up the speed a bit to make it perform more similar to xcode. Rev-by: msorvig
* Implement alien widgets on Mac/Cocoa.Morten Johan Sørvig2010-03-021-1/+2
| | | | | | | | | | | | | | | | | | This commit makes alien widgets opt in on a per-widget basis on Mac, set the Qt::WA_NativeWindow flag when creating the widget to enable. Setting this flag on widgets that have native child or sibling NSViews is not supported. The main use case for alien widgets on Mac is to improve performance for applications that have complex user interfaces. Qt can handle thousands of widgets per window, while Cocoa is designed to use a smaller number of NSViews in combination with NSCells and custom control implementations. This commit moves us in the direction of having a few main NSViews with "leaf" qwidgets implemented as a custom control.
* Mac: using Qt to write plugins disables quit for 3rd party applicationRichard Moe Gustavsen2010-03-011-3/+17
| | | | | | | | | | | | | | The reason is that qt_init always installs/overwrites apple event handlers. So if the 3rd party app had already installed an event handler for kAEQuit, then it will be removed when the Qt plugin is loaded. This patch checks (in the carbon case) if event handlers already exists before installing new ones, or, in the cocoa case, avoids installing apple event handlers if the AA_MacPluginApplication is set. In other words, handling quit etc is seen as the responsibility of the app, and not the plugin. Task-number: QTBUG-8087 Reviewed-by: prasanth
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-02-131-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (28 commits) Optimized QLocale to access system locale on demand. Fix QRegion under Mac OS X. update according to Thiago's comments. Changes: add functionality for dbus auto start to qt Add license header to this file readdir64 is not available on HP-UX Fix bug in QDirPrivate::setPath, affecting QDir::cd, cdUp and setPath qdoc3: Completed handling of the new \pagekeywords command. Wrong cursor shown by the parent window after setOverrideCursor(). Fixed Mac OS X compile time error by using GLint for temp. qdoc3: Added curly braces in switch statement for braindead compiler. qdoc: Added a build rule for the documentation - disabled by default. Doc: Added the qdoc manual to the repository for future maintenance. qdoc3: Fixed bug in creation of qt.pageindex. qdoc3: Added capability to create qt.pageindex. Incorrect property setter generated by dumpcpp for Microsoft Word 2007. Cocoa: Implement our own NSApplication subclass Cocoa: Menu in menubar stays highlighted qdoc: Made a temporary fix for comment highlighting. Doc: Tidied up the class layout and removed an unnecessary image. ...
| * Cocoa: Implement our own NSApplication subclassRichard Moe Gustavsen2010-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We have avoided doing so up till now, since we cannot always know if we will be able to use it. If some 3rd-party application creates NSApplication before Qt, our subclass will never be used (because of the singleton pattern that NSApplication follows). However, in most cases, Qt will be used in standalone applications, or the 3rd-party application will not subclass NSApplication. And in those cases, we can make certain functionallity more robust. Rev-By:msorvig
* | Merge remote branch 'origin/4.6' into qt-master-from-4.6Thiago Macieira2010-02-121-0/+6
|\ \ | |/ |/|
| * Fixed compilation with QT_NO_WHEELEVENTDenis Dzyubenko2010-02-101-0/+6
| | | | | | | | Reviewed-by: Prasanth
* | Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-011-11/+31
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qeventdispatcher_mac.mm src/gui/kernel/qt_cocoa_helpers_mac.mm src/gui/widgets/qmenu_mac.mm tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Gunnar Sletta2010-01-211-1/+1
| |\
| * | Fix how we select antialiasing method for text under Mac OS XGunnar Sletta2010-01-211-11/+31
| | | | | | | | | | | | Reviewed-by: Eskil
* | | Cocoa: implement usage of override cursorsRichard Moe Gustavsen2010-01-281-2/+36
| | | | | | | | | | | | | | | | | | | | | This have never worked in the Cocoa port, it seems. This patch gives it a try. Reviewed-by: msorvig
* | | Merge branch '4.6'Thiago Macieira2010-01-131-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * | Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| |/ | | | | | | Reviewed-by: Trust Me
* | Cocoa: application will not quit when using dialogsRichard Moe Gustavsen2010-01-121-4/+17
|/ | | | | | | | | | | | | | | | When creating a single dialog in the main function, and tell it to exec, we run a modal dialog. But there is really no other window on screen to be modal for. So in that case, since this is a rather common pattern for Qt applications, we allow users to quit the application from the dock. But this action is sendt as an apple event. And and that point in time, cocoa has the the apple event handler, and refuses to close down the application because it detects a modal window. Our solution is to install/overwrite the apple event handler for kAEQuit _after_ cocoa has finished its own installation. But in order to do this, we need to wait until [NSApplication run] has started, otherwise it will not take effect. And that is what this patch essentially does.
* Ensure the button state is correct when creating a QWheelEvent on Mac.Andy Shaw2009-12-031-1/+4
| | | | | | | | | On Mac when we receive a scrollWheel event on Carbon or Cocoa then we need to use QApplication::mouseButtons() in order to ensure the QWheelEvent has the right button states set. This is because the buttons state information is not passed in the native event at all. Reviewed-by: MortenS
* Cocoa: apps with dialogs hangs on exitRichard Moe Gustavsen2009-11-231-1/+1
| | | | | | | | | | | | | This happends because we refuse to exit if we have a modal dialog showing on screen. After some discussion, we decided that we need to allow to exit if the quit menu item is enabled. Some of the reason behind this is the way developers tend to (mis)use dialogs as normal windows in Qt. So, if you don't want your app to exit when showing a modal dialog, disable quit menuitem, or handle QCloseEvent. Task-number: 5613 Reviewed-by: MortenS
* Add support for GetURL events on Mac OS XTor Arne Vestbø2009-11-051-2/+24
| | | | | | | | | | | | | | | | | | | | | GetURL events are delivered by Launch Services to the application if the application is registered as the default handler for the given protocol, and the user for example issues 'open http://foo.com/' in the console or clicks a link in another application. The GetURL event is converted to a QFileOpenEvent, which now has both a QUrl constructor and a url() method. These two new methods work in sync with the file() method, so a QFileOpenEvent constructed from a QUrl will return a valid file name from file() if the URL was a local file. The boolean argument to AEInstallEventHandler decides whether the handler is to be added to the system event dispatch table or the application's event dispatch table. Previously we added it to the system table, but this did not work for the GetURL event. We now use the application event table, which works for all three of the events we register on Carbon. Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Implement support for wheel delta with finer resolution than 15 deg.Richard Moe Gustavsen2009-10-271-31/+6
| | | | | | | | | | | | | | | | | | | | | | | | | At the moment, Qt, in many places, does not really understand that a mouse wheel, or touch pad, might operate on a much higher granularity than 15 degrees (that is, a delta of 120). This is clear disadvantage on mac, since the mighty mouse, and track pad, got a resolution that is close to 1 degree. This is called pixel scrolling. This patch first and formost changes the implementation of QAbstractSlider::wheelEvent to _really_ understand what to do when delta is less than 120. Rather than accumulate delta until 120 is reached, then scroll with a value equal to: offset * step * QApplication::wheelScrollLines (default = 3), we multiply offset directly, before waiting for 120. This means that event tough offset is below 120, multiplying it with wheelScrollLines and step will very often give a value over 120, menaing we can scroll much earlier and _much more_ fined grained. This also fixes some auto tests that was ifdeffed out because of specialised mac code written inside this function from before. (NB: we still plan to introduce a new event for pixel scrolling, perhaps for Qt-4.7) Rev-By: Andreas Rev-By: denis
* Properly detect font smoothing setting on Mac OS X in raster engineEskil Abrahamsen Blomfeldt2009-10-211-0/+11
| | | | | | | | | | | We would assume font smoothing on the mac was always turned on, giving poor text rendering in the cases where it was not. This implementation mirrors querying the cleartype setting on Windows, checking the setting on application initialization and rendering into an 8 bit cache if it is turned off. Task-number: QTBUG-4881 Reviewed-by: Morten Johan Sørvig
* Carbon: better wheel acceleration patchRichard Moe Gustavsen2009-10-081-4/+22
| | | | | | | | | It turns out that scrolling appears to be slow when using non-mac mice with the carbon build. This patch introduces a an acceleration algorithm that closer resembles the one used by Cocoa. Rev-By: prasanth
* Fix: Abstract slider does not understand wheel events properlyRichard Moe Gustavsen2009-10-011-5/+15
| | | | | | | | | | | A wheel event contain delta values that describe the rotation angle the wheel was rotated (in 1/8 of a degree). For some mouse devices (thinking of mac mighty mouse/trackpad) the resolution is better than the standard 15 degrees. The Qt docs describe how to deal with this. But abstract scrollbar does did follow this recipe, but it does now with this patch. Reb-By: prasanth
* Mac: Fix build failure on tigerRichard Moe Gustavsen2009-09-291-0/+11
| | | | | | | | I had to add inn some constants for dealing with pixel smooth scolling on mac when building on Tiger. This is done according to: http://developer.apple.com/legacy/mac/library/qa/qa2005/qa1453.html RevBy:prasanth