summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
Commit message (Collapse)AuthorAgeFilesLines
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* iOS: refactor removeMnemonics(const QString &) to QPlatformThemeRichard Moe Gustavsen2015-11-041-3/+3
| | | | | | | | This function is needed across several OS', so refactor it out to a common place. Change-Id: I35b957029c965672739d03cd2db3e87f5bd0acdf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Get CoreText style name when resolving Qt fontGabriel de Dietrich2015-03-121-11/+4
| | | | | | | | | | | | | Since we use CoreText API to populate the font DB, we should also make sure we use consistent data when doing queries. This partially reverts and ameds b619c35d8507eee. Change-Id: I6a3470fbee719ae1ea3085c252a4870040b9af1a Task-number: QTBUG-41487 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Cocoa QPA Plugin: Remove code depending depending on OS X 10.6 and olderGabriel de Dietrich2014-10-271-5/+1
| | | | | | | Snow Leopard is unsupported from 5.4.0. Change-Id: I5c269cbdc93000a4657b63559cc3c526e298e3db Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* OS X: Remove mnemonics in parenthesesTakumi Asaki2014-08-081-2/+2
| | | | | | | | | | | | In some language, mnemonics put after label text within parentheses. e.g. "&Open" is translated to "開く(&O)" in Japanese. OS X doesn't use mnemonics and '&' in label text is removed. Mnemonics in parentheses (and spaces before them) also should be removed. Change-Id: I88c0a1f60af7e148b3cf24a4e215ce807d62bce3 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Revert "Mac: fix bugs for font selection in QFontDialog"Liang Qi2014-04-281-6/+10
| | | | | | | | | | | | | | | | This reverts commit 3c09f6bc9aee0c97427fe8da6efdc73b4ac473aa. After fbaa6d3ca6fc2693c5c8a1cd8e565803adc97730, OS X/iOS no longer uses localized font names. Task-number: QTBUG-38548 Conflicts: src/gui/text/qfontdatabase.cpp Change-Id: Id7f7e1976e4ffc30c5c18cf57e2acb3aebafc301 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix compile warnings on 10.6Morten Johan Sorvig2013-10-251-0/+1
| | | | | | | | Apple clang 3.0 complains about missing function declarations. Add them. Change-Id: Ib9c3c238c94e8649844cf3e67a659875ad549ecb Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Revert Mac event loop changes.Morten Johan Sørvig2013-09-021-4/+0
| | | | | | | | | | | | | | | "Make QGuiApplication::exec() run within NSApplicationMain()" "Make Qt process native and timer events on Cocoa applications" "Cocoa: Fix QFontDialog, QColorDialog auto-tests" This reverts commits 1e14762b8d79118540bd09a84dd3e48f4f5e113e e4b2a0b4bab2a17a65fedafe9bae50af1fe019f6 df7944e7d7dd8b2bbccbd639eff0ab09745d6cc3 Change-Id: I80b65b5ee0297b090f807bd420664233dfc44f7b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cocoa: Fix QFontDialog, QColorDialog auto-testsGabriel de Dietrich2013-08-291-0/+4
| | | | | | | | | | | | | The new Cocoa event dispatcher made apparent some deficiencies in the way the dialog helpers were being hidden. In particular, we would not stop a dialog helper's modal loop when closing the dialog, resulting in the auto-tests hanging. Also, since the QApplication event loop is runnig with [NSApp run] in the stack, the previous workarounds are no longer needed. Task-number: QTBUG-24321 Change-Id: Ifba713c286638d78a699c319a15683d09714f06f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa: emit currentFontChanged signal in font dialog helperLiang Qi2013-07-311-1/+4
| | | | | | | | | * changeFont is a delegate method of NSFontManager. * exec() will not be called in Qt Quick. Task-number: QTBUG-32450 Change-Id: I05e43ce84d28ff32c88d75bd6ee60653de6ca4f0 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Cocoa: align font dialog helper with the color oneLiang Qi2013-07-311-110/+142
| | | | | | | | The reference color dialog helper change is eeffcfbd89a0b386c5757e8c67b76c5bccc84ffd. Change-Id: I35b505cce133adeed91df7c95b21f7c74c55cb53 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-0/+5
|\ | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| * OSX: Disable window restoration for the Mac font panelLiang Qi2013-07-171-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. Change-Id: I819d7ab4e51e90783d55cee0676dbc33b38c5b00 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Reduce the usage of QT_PREPEND_NAMESPACE in the Cocoa platform pluginRomain Perier2013-05-261-2/+2
| | | | | | | | | | | | | | | | | | 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>
* | Improve Qt-in-namespace implementation in the Cocoa platform pluginRomain Perier2013-05-161-9/+11
|/ | | | | | | | | | | | | 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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Mac: fix bugs for font selection in QFontDialogLiang Qi2012-12-141-10/+6
| | | | | | | | | Use localized family name and style name when selecting font with non-English locale Task-number: QTBUG-27415 Change-Id: Ie81507ed011fc096e0f5edad146e97c392e86494 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Cocoa: fix modal native dialogs with ongoing modal sessionsTeemu Katajisto2012-12-011-0/+4
| | | | | | | | | | | | | Commit 26db7de13d5885067844532b5a5814181a0ddf16 introduced the modal session cleanup for Cocoa print dialog before running the modal event loop for the dialog. Add the same cleanup for Cocoa file, font and color dialog helpers. Task-number: QTBUG-28146 Change-Id: Ifeb7c82566db35f0c6654be7762e9aaffbafb900 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Cocoa: Remove QtWidgets dependencies.Morten Johan Sorvig2012-06-111-3/+1
| | | | | | | | | | Make the file/color dialog helpers use QCoreApplication:: translate("QDialogButtonBox", text) instead of QDialogButtonBox::tr(text) Change-Id: I7ee4c32f8f8b9cd002836e24b962ef1c0f2e0737 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* qpa: Remove QPlatformDialogHelper::deleteNativeDialog()Bradley T. Hughes2012-05-101-9/+6
| | | | | | | | | | | | | | | | This function isn't really needed. The QDialogPrivate destructor deletes the platform helper, so the QDialog destructor does not need to do it. Subclasses of QPlatformDialogHelper are now responsible for deleting any native resources they create. The one place in QFileDialog that needs to recreate the native dialog can simply recreate the helper. QDialogPrivate::deleteNativeDialog() now becomes QDialogPrivate::deletePlatformHelper(), which resets all state to allow the platform helper to be recreated. Change-Id: I58adfe8801e02e63b3cb4a9a3a0b8cb5b3c7b161 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qpa: Clean up QPlatformDialogHelper APIBradley T. Hughes2012-05-101-6/+6
| | | | | | | | | | Remove the _sys suffix from all members of QPlatformDialogHelper and its subclasses. The QPlatform* class prefix already implies that these methods are system specific, we don't need the method suffix as well. Change-Id: I5ad1f928fab3a989992951acc244915e7fa48d32 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QPA: Cleanup native dialog modal executionBradley T. Hughes2012-05-091-27/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the _q_platformRunNativeAppModalPanel() function, together with the launchNativeAppModalPanel() signal and emitLaunchNativeAppModalPanel() slot, which were previously used to run the modal loop inside the QDialog::exec() loop. This trick isn't necessary anymore, so remove the mechanism and code related to it. Rename QPlatformDialogHelper::platformNativeDialogModalHelp() to exec_sys(). This function is now responsible for both showing the native dialog and running the modal loop. QDialog:exec() now calls this function if a native dialog is in use (it does not call QEventLoop::exec() anymore). The dialogResultCode_sys() function was unused, so it has also been removed. This commit also removes some unused private slots that were left over from the port to QPA. Note that the comments in the Cocoa plugin are still valid and relevant, but this commit does not fix the scenarios mentioned. This will be done in a future commit. The Windows plugin needs minor changes. The QueuedConnections to accept() and reject() cause the deliver to come too late, resulting in crashes, hence the change to AutoConnection (which ends up being a DirectConnection). Change-Id: Ifc90325c945ca78737e60bf331929f03ecc52e0a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Don't leak native dialog resourcesBradley T. Hughes2012-05-091-3/+1
| | | | | | | | | | | | Have QDialog::~QDialog() call deleteNativeDialog_sys() on the helpers, so that we don't risk leaking any resources allocated in the helper. QFileDialog does this now, but not QColorDialog or QFontDialog. The Cocoa plugin worked around this problem by calling deleteNativeDialog_sys() itself, but the Windows plugin does not do this, resulting in leaks. Change-Id: I380d87c95686c8f3cb260f9242299be27329280d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Support all modality types in QPlatformDialogHelperBradley T. Hughes2012-04-301-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modality is not a boolean property in Qt. There are 2 types: window modality and application modality. Native dialogs can support both of these types as well (e.g. on Cocoa, a window modal file dialog should be displayed as a Sheet). Remove the QPlatformDialogHelper::ShowFlags enum and instead pass a Qt::WindowModality parameter to QPlatformDialogHelper::show_sys(). The Windows implementation has been updated to check for Qt::ApplicationModal instead of the ShowModal flag (since only Qt::ApplicationModal dialogs are blocking). The Cocoa implementation has been updated to only use non-modal and application modal native color and font dialogs (which restores Qt 4 behavior). These are shared Cocoa panels that cannot be shown as sheets, however. If the programmer asks for window modal color/font dialogs, we use the Qt versions, not the native ones. The file dialog can be shown either as a Sheet (but we need to pass an NSWindow parent for it to work properly) or as an application modal dialog. This change has been tested on Mac OS X with tests/manual/windowmodality. Change-Id: I9064987433895c55f68aac979ef8e8207fb24bbe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: Proper handling of mDelegateChristoph Schleifenbaum2012-04-121-0/+4
| | | | | | | | | | | | | mDelegate keeps the pointer to a QNSFontPanelDelegate, which reacts on the NSFontPanel used by this dialog helper. It has to be created before it can be used. On a read-only access, this has been fixed to return a default-constructed value (like QFont()). For writing access (like setting the font) the delegate was already created. The same applies to mDelegate to QNSColorPanelDelegate respective. Change-Id: I36b89c16d98db9275aa31d399fe094b1d56d800d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* CompileBradley T. Hughes2012-02-141-1/+0
| | | | | | | mHackedPanel is not declared anywhere in the Cocoa dialog helpers. Change-Id: I3ba5dd429aa9fe5833b19c1e081425ec4020658d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add QCocoaColor- and FontDialogHelperChristoph Schleifenbaum2012-02-141-0/+488
Change-Id: Ie6e648e9e1f4ffbb34d73f9afdd6cc77e86bc3d1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>