diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-14 15:46:44 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-14 15:46:44 (GMT) |
commit | 591131dca30622a2f7cd8e994a826384115edc84 (patch) | |
tree | 1e89d1047ae3809d328743de2961c840f39561dd /doc/src | |
parent | 5de30ecf4c28279fe8eed0ed8cb53504eb1350d7 (diff) | |
parent | 65e0fe383bba7b75e3ff5f8dd1bf3bb61a8bc589 (diff) | |
download | Qt-591131dca30622a2f7cd8e994a826384115edc84.zip Qt-591131dca30622a2f7cd8e994a826384115edc84.tar.gz Qt-591131dca30622a2f7cd8e994a826384115edc84.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging:
Merge request: 1111
Doc: inform better about how you can tweak Qt apps on Mac
Mac: add support for closing dialogs using Cmd-D
Cocoa: use mouse location from event
Cocoa: implement eventdispatcher flag excludeUserInputEvents
Cocoa: processEvents does not always send posted events
Added QMdiArea::tabsMovable and tabsClosable
Enable the widthForHeight() test case.
Fix some wrong tests in heightForWidth()
Fix and enable the tests that were disabled.
Fixed a double selection in QFileDialog when saving
fix qFadeEffect windowOpacity issue on Windows
Cleanup unused QAccessWidget
Fixed a problem with toolbars not relayouting
Compile fix on solaris
Autotest illustrating Qt::InitialSortOrderRole
Mention when the role was introduced
Add a way to set QHeaderView initial sort order
Doc: Fixing typo
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/platforms/platform-notes.qdoc | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index de6eb7f..113ad86 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -602,6 +602,69 @@ problem, it probably is a good idea to turn off precompiled headers. Also, consider filing a bug report with Apple so that they can improve support for this feature. + + \section2 Attributes + The following lists a set of useful attributes that can be used to tweak applications + on Mac: + + Qt::AA_MacPluginApplication, Qt::AA_DontUseNativeMenuBar, Qt::AA_MacDontSwapCtrlAndMeta + Qt::WA_MacNoClickThrough, Qt::WA_MacOpaqueSizeGrip, Qt::WA_MacShowFocusRect, + Qt::WA_MacNormalSize, Qt::WA_MacSmallSize, Qt::WA_MacMiniSize, Qt::WA_MacVariableSize, + Qt::WA_MacBrushedMetal, Qt::WA_MacAlwaysShowToolWindow, Qt::WA_MacFrameworkScaled, + Qt::WA_MacNoShadow, Qt::Sheet, Qt::Drawer, Qt::MacWindowToolBarButtonHint, + QMainWindow::unifiedTitleAndToolBarOnMac + + \section2 Mixing Qt with native code + Two classes are awailable for either adding native Cocoa views/controls + inside a Qt application, or the opposite, embedding Qt into a native + Cocoa application: + + QMacCocoaViewContainer, QMacNativeWidget + + \section3 Using native Cocoa panels + Launching native Cocoa panels from within a Qt application can sometimes + be problematic. The reason is that Qt's event dispatcher is more flexible + than what Cocoa offers, and lets the user spin the event dispatcher (and + running QEventLoop::exec) without having to think about whether or not modal + dialogs are showing on screen (which is a difference to Cocoa). Therefore + we need to do special bookkeeping in Qt to handle this correctly, which + unfortunately make mixing in native panels hard. The best way at the moment + to do this, is to follow the pattern below, where we post the call to the + function with native code rather than calling it directly. Then we now that + Qt has cleanly updated any pending event loop recursions before the native + panel is shown: + + \code + #include <QtGui> + + class NativeProxyObject : public QObject + { + Q_OBJECT + public slots: + void execNativeDialogLater() + { + QMetaObject::invokeMethod(this, "execNativeDialogNow", Qt::QueuedConnection); + } + + void execNativeDialogNow() + { + NSRunAlertPanel(@"A Native dialog", @"", @"OK", @"", @""); + } + + }; + + #include "main.moc" + + int main(int argc, char **argv){ + QApplication app(argc, argv); + NativeProxyObject proxy; + QPushButton button("Show native dialog"); + QObject::connect(&button, SIGNAL(clicked()), &proxy, SLOT(execNativeDialogLater())); + button.show(); + return app.exec(); + } + + \endcode */ /*! |