summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* Don't link QtPlatformSupport to CoreFoundation or CarbonTor Arne Vestbø2013-02-221-1/+1
| | | | | | | | | | | Move the Carbon dependency to the Cocoa platform plugin instead, where it's actually used. CoreFoundation was not used by any plugins and could be removed completely. Change-Id: I1c825cdf94e2cc348ea13519b894fd868be0d14a Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-202-0/+10
|\ | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/unix/separate_debug_info.prf src/gui/kernel/qwindow_p.h src/plugins/platforms/cocoa/qcocoacursor.mm tests/auto/tools/moc/tst_moc.cpp Change-Id: Ieb57834c00f961a747ffe51e6eb9fc9612cebccf
| * Clean up the cached cursors inside the destructor of QCocoaCursorAndy Shaw2013-02-202-0/+5
| | | | | | | | | | Change-Id: I4e1222832efa29680b4e658a5c9109641599a2b9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Fix the default handling of cursor shape when there is no standard oneAndy Shaw2013-02-201-0/+5
| | | | | | | | | | | | | | | | | | When the cursor specified is a bitmap one we cannot cache it based on the shape as the pixmap set on the cursor may be different. Therefore we should always create a new cursor in this instance. Change-Id: I2c201590ff632490d76c1b423908ae32aa584eb6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-02-181-5/+4
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-181-5/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| | * Fix globalPos() in scrollwheel events on OSX.Josh Faust2013-02-141-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The window position was getting passed as both the window and global positions. QTBUG-29543 Change-Id: I24746675e5ba45adbd054742877bd2fe783d6608 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | QScreen::refreshRate would return 0 on Mac OS XGunnar Sletta2013-02-181-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | The function we use to get the actual vsync on cocoa is documented to return 0 if the monitor is not a CRT monitor. A refreshrate of 0 means we have vsync deltas of 1000/0 which cause problems elsewhere. It is better to use the "default" value in this case as it will be closer to correct than 0. Change-Id: Id08007e40a9af5e42f13a07628fcad5fd3a7d0dc Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Cocoa QPA: Make QCocoaMenu::menuItemAt() more robustGabriel de Dietrich2013-02-181-1/+4
| | | | | | | | | | Change-Id: I2c68f87eb1a4926ca5bd0bfcc842ab9c56c99cd7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Remove ifdefs for supporting Mac OS <= 10.5Tor Arne Vestbø2013-02-1810-84/+4
| | | | | | | | | | | | | | | | Qt5 requires Mac OS 10.6, so we can remove checks such as if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 Change-Id: Iea21727a277291148704ecf9677ed0b68c24920f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Giuseppe D'Angelo2013-02-1712-33/+96
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-1412-33/+96
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| | * Cocoa: Export QImage <-> CGImage conversion funcs.Morten Johan Sørvig2013-02-125-23/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For implementing to/fromMacCGImageRef in QtMacExtras. These do not depend on internal Qt state. The main reason for exporting them is to keep the implementation in one place to ease maintenance. Refactor qt_mac_cg_context to support QImage. Add qt_mac_toQImage. Change-Id: Ia9c226ed52d087b2c6b47aa8210ed8f2645b9cf2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * Fix devicePixelRatio getter for embedded QWindows.Morten Johan Sørvig2013-02-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m_nsWindow is not set for non-toplevel QWindows, causing devicePixelRatio to always return 1. Use [m_contentView window] instead. Change-Id: I6689a70812c9484f103b5e706fe4c1b76406b750 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * Cocoa: Make tool window receive mouse events also when its parent is modalGabriel de Dietrich2013-02-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | We need to check for the Cocoa window class because of the way currently QDockWidget works. Change-Id: If69c7327c168518614fe884defa79deb358e260d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * Cocoa QPA: Fix compilation errorGabriel de Dietrich2013-02-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error appeared with latest clang as of Feb. 5, 2013. Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.0 Change-Id: I8df8cccc941ac03a7a997bdd5afe095b7b6f65d3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| | * Cocoa: prevent scale factor value of 0.Morten Johan Sørvig2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Check that the NSWindow pointer is valid before calling backingScaleFactor. Change-Id: Ia23cbb4058b7d0fece008bc437f8bfec6c0ddebe Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * Mac: Ensure the native filedialog sets file name when savingLiang Qi2013-01-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The name field string was not set in native dialog when one was present. Task-number: QTBUG-28342 Change-Id: I243b491c8bc094d45f25be96b3bde8eccbb65acd Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * Mac: make windows not restorable on 10.7 and laterLiang Qi2013-01-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default value for NSWindow::setRestorable: is true, it means application will have some information for each window stored. After a crash happened and application relaunched, the application tries to restore those windows from the broken file. And then the "Retore Windows" will pop up. There is no workaround for application users or develoeprs. What they can do is to manually remove the the saved application state file for the applicaiton. To avoid that, better to switch it off. Task-number: QTBUG-28281 Change-Id: I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * Fix minor typos in docs, printed messages & commentsSze Howe Koh2013-01-283-3/+3
| | | | | | | | | | | | | | | | | | | | | Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| | * Cocoa: export setDockMenuMorten Johan Sørvig2013-01-282-0/+17
| | | | | | | | | | | | | | | Change-Id: I1eb35c34427660d2662f310a3e8c4e5ba42e08eb Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | | Cocoa: QSystemTrayIcon showing native messages on Mountain Lion.Christoph Schleifenbaum2013-02-161-1/+46
|/ / | | | | | | | | | | | | | | | | | | This patch enables usage of the new NSUserNotificationCenter as part of Mountain Lion. On earlier versions, or if compiled on earlier versions, Growl will be used, if installed. Change-Id: I676f9c63aa3c1ada19d36b6310ae90915be63011 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | QPA Cocoa Menu: Make sure mouse button state is clean after popupGabriel de Dietrich2013-02-113-12/+12
| | | | | | | | | | | | | | | | | | | | | | Calling popUpMenuPositioningItem:atLocation:inView: will swallow any mouse up/released event, if we popup on mouse down/pressed. Since we cache the button state in QNSView, the safest way seems to be to clear this button state. Another option would be to send Cocoa mouse up events for each mouse button, but we prefer to keep things simple. Change-Id: I7f3f369c45e9f5ed9d2ab693bffd8be4a4596ae6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Add support for getting the paper names available for the printerAndy Shaw2013-02-112-0/+32
| | | | | | | | | | | | | | Task-number: QTBUG-27714 Change-Id: I9bc6f1188f262e43f581add058d7895e1b5bd9e3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Add enablers for Android port in QPlatformMenuEskil Abrahamsen Blomfeldt2013-02-052-0/+3
| | | | | | | | | | | | | | We need a couple of functions here for the Android support. Change-Id: I50e27277d7e838e277d616dbd3af9be817fb7197 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-296-117/+32
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-286-117/+32
| |\| | | | | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| | * Cocoa: Correct mime handler prioritization.Morten Johan Sørvig2013-01-281-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the documentation recently added mime type converters should take precedence over previously added converters. Make it so. Task-number: QTBUG-25951 Change-Id: Ic23ca7cbb93a98711d762b1ef0e0dd2aa1ceaeda Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * cocoa: Fix Mouse Event tracking of button statusRick Stockton2013-01-252-111/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Within qcocoahelpers, make function cocoaButton2QtButton() handle all button numbers. Within qnsview, call the function in several places (eliminating duplicate, inefficient code). Task-number: QTBUG-28567 Change-Id: Ibae2ae4e8a881b825a8862afb82aa80437751111 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Rick Stockton <rickstockton@reno-computerhelp.com>
| | * Doc: Fix module name formatSze Howe Koh2013-01-253-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-293-12/+0
|/ / | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* | Switch to struct timespec everywhere instead of timevalThiago Macieira2013-01-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This avoids an extra division by 1000 when getting the current time. This can't overflow, under normal circumstances, even on 32-bit: when adding two values less than 1 billion, the result is less than 2 billion, which is less than 2^31. Change-Id: I6f8e1aadfe2fcf6ac8da584eab4c1e61aee51cbb Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-241-0/+33
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: I4ca87d44129fa5c1d8541cd58b8d62bc69080688
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-01-241-0/+33
| |\ | | | | | | | | | Change-Id: Idcaa9b0c63aca5ba11ee3fa2da456178655a1ae3
| | * Cocoa: Backport Qt 4's QCocoaView tracking areas into QNSViewGabriel de Dietrich2013-01-221-0/+33
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-29153 Change-Id: Ib190c074defaa459a8acc738f09af4a65e5d91d1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2375-89/+147
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2275-89/+147
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| | * | Export functions to add custom mime converters.Morten Johan Sørvig2013-01-215-9/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For use with public API in QtMacExtras. This goes into Qt stable: Fix for new functionality, and close a feature regression against Qt 4. Change-Id: I555fdff3ddb39336ccd72f9711d465f1c18c6b45 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * | Make sure the correct name filter is selected in the Mac file dialogAndy Shaw2013-01-181-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we have to add the filters one by one to the Mac file dialog it was finding the one that would match the filter by comparing the start of the filter string. However it would continue to check the start of other filters even if it had already found the one it should be using. Now it uses either an exact match or the first one that it matches the start of. Change-Id: Ie6441acd48e45ec9c712afc12a2ea47755835bb3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * | Call endSheet when the QFileDialog was shown as a sheet on MacAndy Shaw2013-01-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the sheet is not ended then subseqent calls to show a sheet will not work correctly. Change-Id: Ib8a43a1c96a3dadff196c433e822f7579ad87b8b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * | Update copyright year in Digia's license headersSergio Ahumada2013-01-1875-75/+75
| | | | | | | | | | | | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | Several bug fixes in QCocoaFileDialogHelper to support declarativeShawn Rutledge2013-01-231-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Required to prevent crashes and incorrect behavior in https://codereview.qt-project.org/#change,44201 Change-Id: If6025429caabafd150cdd44fec152ff584232220 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | | Implement focus handling of child windows for cocoa.Gunnar Sletta2013-01-234-0/+27
|/ / / | | | | | | | | | | | | Change-Id: I1e05ef39aa67f8febdd27215d8ad05d26ece7caa Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | Regression: Fix setting of custom cursors for native widgets.Friedemann Kleint2013-01-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is no concept of not having a cursor set on a Window. Qt::ArrowCursor is always set instead. This causes bugs when native child widgets are involved, for example setting a cursor on the native widget's parent no longer works since the child's Qt::ArrowCursor applies. Introduce QWindowPrivate::hasCursor tracking whether a cursor has been explicitly set and clear in QWindow::unsetCursor(). Handle 0 in QPlatformCursor::changeCursor() to mean "unsetCursor()": - Windows: Introduce default constructor for QWindowsWindowCursor meaning "0". Search for applicable parent cursor in applyCursor. - XCB: No big changes required, set XCB_CURSOR_NONE for no cursor. - Other platforms: Assume Qt::ArrowCursor when cursor = 0 is passed for now. Task-number: QTBUG-28879 Change-Id: Id82722592f3cd5fe577a5b64dcc600c85cfea484 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | Cocoa: Make QCocoaMenu::showPopup() more robustGabriel de Dietrich2013-01-211-2/+2
| | | | | | | | | | | | | | | Change-Id: Ie4ae5806ea2f23f16597578796be36f2123c05fa Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-164-8/+16
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qstyleanimation.cpp Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
| * | More explicit QCocoaAccessibleElement memory mngmtMorten Johan Sorvig2013-01-094-8/+16
| |/ | | | | | | | | | | | | | | | | | | Don't autorelease in the elementWithInterface function, rename it to createElementWithInterface. The element can then be released immediately or autoreleased ("delete later"). Change-Id: I155a85404c34d756c1752eb7c24a7fb0f3cf2e77 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | QPA, Cocoa: Add platform popup menusGabriel de Dietrich2013-01-112-1/+42
| | | | | | | | | | | | | | | | Also, allow to set menu-wide font (instead of per menu item), and minimum width. Change-Id: I5f83f260602f55b9409ad69abf670afb59b2d33a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Refactor paint/font-engine shouldDrawCachedGlyphs and supportsTransformationsTor Arne Vestbø2013-01-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some cruft had built up over time, and this is an attempt at cleaning up the naming and use of these functions, and should not have any behavioral effects. The function supportsTransformations() has been renamed in QPaintEngineEx to reflect its use, which is to decide if QPainter needs to pre-transform the coordinates of the static text before asking the paint-engine to draw it. The new name is requiresPretransformedGlyphPositions(). The OpenGL and CoreGraphics (Mac) paint engines keep their behavior of not needing pre-transformed text, while the raster engine needs this when using cached glyphs. The base-class implementation assumes that all transforms that include a projection will need pre-transform, which is also the case for the raster engine. All decisions in the paint engines about whether or not to use the glyph cache when drawing text are now deferred to the function shouldDrawCachedGlyphs(), which has been refactored for the GL paint engine(s) to share more logic. All implementations call the base class implementation, which ensures that large font sizes will not be cached. The raster engine will in addition ask the font engine whether or not it can produce glyphs for the glyph-cache with the given transform. This is the only remaining instance of the supportsTransformations() function, and will for all font engines except the CoreText engine support affine transformations. The CoreText engine on the other hand only supports translations (for now). Change-Id: I8fb5e43e3de3ef62a526a79a6dfeda7f9546771d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-072-9/+14
|\| | | | | | | | | | | | | Conflicts: tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47