summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Add API to let applications integrate with the system fontsAleix Pol2013-07-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does 2 things mainly: - Adds a QPlatformTheme font type for fixed fonts. It's important because some OS provide specific monospaced fonts and we want to let our applications to use the preferred fonts by default. - Adds a new method and enum to QFontDatabase that expose the font types that applications might need, so that they can make the applications use the specific fonts that the system recommends. This data was already available within Qt through the QPlatformTheme, but it was not possible to use this data by Qt users. This new method exposes such data. Change-Id: Ic194c1e4bc07a70640672afd82ba756b87606985 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-278-48/+46
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/features/create_cmake.prf Change-Id: I94aea83b83833395d5db399209e0e51b92ef23b5
| * | Mac/XCB/Windows: Fix initial setting of window icons.Friedemann Kleint2013-06-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting an icon on a QWindow before creating the platform window did not have any effect. Task-number: QTBUG-31961 Change-Id: I8e58a3b239c8bc69af58f765e7826337463d2201 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * | Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Frederik Gladhorn2013-06-251-6/+10
| |\ \ | | | | | | | | | | | | refs/staging/stable
| | * | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-201-6/+10
| | |\| | | | | | | | | | | | | Change-Id: I94bb158562ae6b80a87b40139d7302ea7b9b9aa8
| | | * OSX: Disable window restoration for the Mac color panelShawn Rutledge2013-06-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because if it is automatically restored it's out of the application's control, so the user's interaction will be ignored. Change I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 did this for normal windows by default, but the dialog helpers generate windows which aren't affected by that. Task-number: QTBUG-31750 Change-Id: I636bd87b664a489a2dc8693dad5370a715b1cf7b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | | * Cocoa color dialog cannot be modal, but should show anywayShawn Rutledge2013-06-151-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Silently failing doesn't seem the right way to handle this. Updated docs for DontUseNativeDialog option: it's not just for the Mac anymore. Ensure that the Qt dialog and Mac panel will never be shown at the same time. Change-Id: Ia9e80754df6c7622d9039c8dd050ac4de771a030 Task-number: QTBUG-29161 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | | * OSX color dialog can be accepted repeatedlyShawn Rutledge2013-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QNSColorPanelDelegate::finishOffWithCode sets mResultSet = true and it needs to be set false again the next time the dialog is shown. Task-number: QTBUG-31566 Change-Id: If1d4bb9d4e76273c6423f5bf2ae37790e8a9704e Reviewed-by: Liang Qi <liang.qi@digia.com>
| * | | Mac Accessibility: unify child functionsFrederik Gladhorn2013-06-244-37/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both ways of getting the children are the same for nsview and qcocoaaccessibleelement. Factor out a function. Change-Id: I4be091c6acde0de519a358f879c24eae04ec4c8d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * | | Fix typo QCocoaAccessibilityFrederik Gladhorn2013-06-233-10/+10
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib3fe4e30097af9c5c577757594196710c0998184 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * | | Remove NSPICTPboardType from pasteboard types.Morten Johan Sørvig2013-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NSPICTPboardType is deprecated. Mac OS will translate pasted images of that type to a different image format. Change-Id: Id7a68509615816a852abf1c11a70f0f0c862f0f2 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Mac Accessibility: skip invisible childrenFrederik Gladhorn2013-06-212-0/+6
| |/ / | | | | | | | | | | | | Change-Id: I6c3da526ecef60447a658b6b5501282729e9c6f5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-208-24/+60
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp tools/configure/configureapp.cpp Change-Id: I3092bd3276af14304b7ab3ae1e1cc05d11cdede0
| * | Cocoa save file dialog behavior fixSamuel Gaist2013-06-161-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, in save mode, if selectFile has not been called, the native cocoa file dialog puts the folder name in the line edit. This patch restores the old behavior where the line edit is presented empty to the user. Task-number: QTBUG-31619 Change-Id: I938eb6d968e0e2c343e70bc19f29663e112d0496 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| * | Fix for OS X QFileDialog showing bundle as directorySamuel Gaist2013-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also check if the selectedFile is a bundle to correctly set currentDir. Patch for Qt 4.8 has been submitted Task-number: QTBUG-31562 Change-Id: I72b0e8484b3c3a610932c03cd7fdab4ddee70277 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| * | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-127-14/+51
| |\| | | | | | | | | | Change-Id: If29ca1b27da4592d40a7678837c359f75dac1209
| | * Cocoa: Make QWidget::showNormal() work on minimized windowsGabriel de Dietrich2013-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cocoa sets the NSWindow hidden when it's minimized, and we don't propagate that further to QWindow or QWidget (QWidget's 'visible' documentation is quite ambiguous about that state). The obvious fix is to check for QWindow's visibility. However, this might need to be corrected later if we truly want the visible state to be in sync. Task-number: QTBUG-31117 Change-Id: I457452eff75e6ea746a0ef5351104f8bbb65f98b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * Cocoa: Make sure internal minimized state is up to dateGabriel de Dietrich2013-06-122-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | Refactors some code from previous changes addressing the same issue for maximized and fullscreen states. Change-Id: I8a27274a90e6610b424ea7af3269369a1d724c48 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * Cocoa: Update window state when maximizing from the title barGabriel de Dietrich2013-06-124-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | There's no NSWindow notification we can listen to, but we can override behavior from its delegate. Change-Id: I61cebf4119f83c770fe4e7f45ff0d4e8bf9d0df9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * Cocoa: Make sure we update internal window fullscreen stateGabriel de Dietrich2013-06-123-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We update the internal/synched state by assigning it its QWindow's state. Since that one is not a flag, it can only be in one state at a time, meaning that we may lose the maximized state (but we've been losing it for some time). Task-number: QTBUG-30139 Change-Id: Idf30713c6ae912cafe3bbdd7be18214cf4de34f7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * Cocoa: Remove compilation warningGabriel de Dietrich2013-06-121-0/+1
| | | | | | | | | | | | | | | Change-Id: Ib530e7ef4643de07aec91c4af0de8bbedef9882a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| | * Fix issue when QKeyEvent::text() was returning empty stringGatis Paeglis2013-06-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that sets 'text' variable was executed only for KeyPress events. This patch moves 'text' initialization higher up where it will be run for both - KeyPress and KeyRelease events. Task-number: QTBUG-31285 Change-Id: I140de9ef5d29beedad276d348bed964ecdf46f9d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-128-29/+73
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenubar.mm Change-Id: I4a699fc8a7f30b2af9de8e496c3d5f027b7495bb
| * | Fix leak in QCocoaDrag.Ivan Komissarov2013-06-111-1/+3
| | | | | | | | | | | | | | | Change-Id: I2961d08f95c68446a2893721dc79ba56bf98c0de Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-104-22/+66
| |\| | | | | | | | | | Change-Id: I89c251999ae2a82522b40471fd13f2e06b00ece8
| | * Cocoa:Fixed crash when sharing QMenu between two QMenuBar instancesRomain Perier2013-06-074-22/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't insert a NSMenuItem into a NSMenu if this one already belongs to another NSMenu, this is forbidden in the Cocoa framework and raises an Exception. The solution consists in tagging the menu as sharable and moving it from one menubar to another when the window gets focus. Task-number: QTBUG-31342 Change-Id: Ic3bfadd4704f363ac26122ae15547543a0f6d44d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * | Cocoa Accessibility: fix ignoring of objectsFrederik Gladhorn2013-06-072-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Mac it's expected that some elements are filtered out of the a11y hierarchy. We do this with the shouldBeIgnored function. The problem is that we would ignore some objects and then return them in the child attribute function. This is inconsistent and leads to voice over not working. For example having a plain QWidget with other widgets as children would cut off all of these widgets, since the plain QWidget would be ignored. Change-Id: I5f6c26b272e5ca57d59c1ed1ef47e9a2b1181295 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * | Fix themeHint typo in qcocoatheme: PasswordMaskDelay should be ↵Daiwei Li2013-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | PasswordMaskCharacter Task-number: QTBUG-31498 Change-Id: Ie6b1b0a2238923e37d52fa2e90782e874bb224b4 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-049-35/+62
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/plugins/platforms/cocoa/qnsview.mm Change-Id: I6fe345df5c417cb7a55a3f91285d9b47a22c04fa
| * | Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Frederik Gladhorn2013-06-037-33/+24
| |\| | | | | | | | | | refs/staging/stable
| | * Use [NSEvent characters] to retrieve the input character.Gatis Paeglis2013-05-301-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 (cherry picked from commit 6730413fcac1d7eb39af3683b87f965c5823cb6c) Change-Id: Ic28eb55b3a9798ecb6012cc2e3fb18589b8b0392 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | * Move QBasicDrag and QSimpleDrag to QtGui.Samuel Rødal2013-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are useful as default implementations of QPlatformIntegration::drag(), instead of having it return 0 which will lead to crashes in Qt Quick 2 and widgets applications that use drag and drop. Task-number: QTBUG-31288 Change-Id: I70efa139306ced5d879def0f74e3a72d3bcd64f7 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * QMenu: Remove last references to QMacWindowFaderGabriel de Dietrich2013-05-302-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was never ported to Qt 5, and 10.7 has simple API for that. Task-number: QTBUG-31336 Change-Id: Ie00c4ed3af9cd098c9e63eba1c654f1801aa83aa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | * Cocoa: Allow delayed title setting in menu itemsGabriel de Dietrich2013-05-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is what happens in uic generated code. Therefore, we should not mark an item as text-synced until it's got its text set. Task-number: QTBUG-31378 Change-Id: I7bb7db8abad922b50546c7669d285369ebf01394 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | * Cocoa: Hide empty menus from the menubarGabriel de Dietrich2013-05-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-31378 Change-Id: I33ab2979a26166fb07e836c85dfc8089af5e1fda Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | * Cocoa: Use actual modifiers when sending ShortcutOverride eventGabriel de Dietrich2013-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Probably a typo since keyCode clearly has no modifiers encoded. Change-Id: I1c7908b06a759baf7b2c3462861a5d61f8c52b9f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * | Fix leak in QNSView.Ivan Komissarov2013-05-311-0/+2
| | | | | | | | | | | | | | | Change-Id: Ide0e826bf068340c86d87a8ccbb3bd58b60f6d8c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * | Support Mac key equivalent Cmd+PeriodGatis Paeglis2013-05-312-0/+18
| |/ | | | | | | | | | | | | | | | | | | On Mac Cmd+Period isa special key combination which never got delived to Qt application. We can intercept these special keyboard shortcuts in the performKeyEquivalent function. Task-number: QTBUG-11386 Change-Id: I680385bde07b2810e8bde86ec9fbbe7e09156c84 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Fix transparent toplevels on Mac OS X again..Gunnar Sletta2013-05-283-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're using QWindow::format() to decide opacity or not in a few places, but this used to resolve to QPlatformFormat::format() which would in turn return a default format without alpha set. Instead, return the format requested by the user. Masked windows were always broken as converting a 32-bit image to an Indexed8, doesn't give a grayscale image, but rather a randomly spreadout set of indices based on the colortable generated by the converToFormat function. Task-number: QTBUG-28531 Change-Id: I537288f85c70b1e6194785b9ebcb5ea1f9581cee Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Fix crash in QCococaWindow::childWindowAt().Friedemann Kleint2013-05-231-9/+5
| | | | | | | | | | | | | | | | Task-number: QTBUG-31297 Change-Id: I96f4652e410334fae54a0012ed917a965becfe5c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Reduce the usage of QT_PREPEND_NAMESPACE in the Cocoa platform pluginRomain Perier2013-05-265-43/+43
| | | | | | | | | | | | | | | | | | This is no longer required as QT_USE_NAMESPACE is used most of the time Task-number: QTBUG-23946 Change-Id: Ia6225260531adbf34ec1846805b8fe1d66dbaef8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-05-239-28/+101
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/corelib/json/qjsonwriter.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbkeyboard.cpp Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
| * Cocoa: Amend 5d07a4d9448f60 to avoid an assert in QWidget::mapTo()Gabriel de Dietrich2013-05-231-1/+2
| | | | | | | | | | | | | | | | For now, we only call 'flushWindowSystemEvents()' for top-level QWindows. Change-Id: Ie6f6d3f9b70241820d9c38bcc0caf832d521268b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Process initial expose events immediately.Morten Johan Sørvig2013-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Required to prevent qmlscene flicker on startup. Also brings back that qWait() in tst_QGL::graphicsViewClipping() that seems necessary after all. Amended-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Change-Id: I14ba6e18ac98e5df1ce8ecbc263b30176b67d111 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Make QWindow update its screen when moved to a different oneGabriel de Dietrich2013-05-233-1/+26
| | | | | | | | | | | | | | | | Also implements the Cocoa backend for that. Change-Id: I32977e12a04e1cf48b12333442482746c69ce133 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Cocoa: Make sure main window gets focus after closing modal dialogGabriel de Dietrich2013-05-231-3/+15
| | | | | | | | | | | | | | | | | | | | As explained in the code, this is due to our event dispatcher. This could also make applications crash due to the way we bind windows to the menubar in the Cocoa QPA plugin. Task-number: QTBUG-30451 Change-Id: I6dd190d5b3b83f1216caec0b14414efa771634a5 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Cocoa: Remove "Incomplete implementation" compilation warningGabriel de Dietrich2013-05-231-1/+1
| | | | | | | | | | Change-Id: I1db62c2504b55ef1451cb147d745c19cbef7de1e Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * A Dialog should not hide when the application is deactivatedShawn Rutledge2013-05-231-1/+3
| | | | | | | | | | | | | | | | To get this behavior, use Qt::Tool. Task-number: QTBUG-31133 Change-Id: I4811b5fe7e180a63bcdfe8018b35a56b370d9b61 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| * Ignore mouse enter/leave on non-exposed windowsShawn Rutledge2013-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you put two OpenGL widgets in two tabs, you will have several QNSViews on the Mac (because using OpenGL forces a lot of the widgets to be non-alien). The GL widget on the non-visible tab will not be exposed, but QCocoaWindow::childWindowAt is recursive and was returning the last window found which contained the mouse location; but the children are not reordered when switching tabs. It should ignore the invisible windows and report that the mouse entered the one which is visible. Task-number: QTBUG-30934 Change-Id: Iae28db56e15815671bf39e1b1f382c8c285532bd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| * Prevent windows from jumping when changing geometry on OS XTor Arne Vestbø2013-05-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were setting the frame origin and content size as two separate steps. The frame origin was asynchronous, while the content size was synchronous. This resulted in the window visually jumping/moving, instead of applying the new geometry in one single step. We now set both in one go using setFrame, by manually calculating the frameRectForContentRect. This makes the whole process asynchronous. Task-number: QTBUG-31039 Change-Id: Iaba46106b9f200c707507f330fa801c99e2e7d89 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>