summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-01-20 10:22:32 -0800
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-01-23 18:29:57 +0000
commit40827457a7883bf2465b5365c9e95f38a59404d5 (patch)
tree1c309c29c987877c3e2d5e3044fff20130dde099 /src/widgets/widgets
parentdf7a65afdaef4a402bbc2c7af27688678856887d (diff)
QMacCocoaViewContainer: Fix typos, wording in documentation
Also removes reference to Carbon and the old dual backend. Change-Id: I01292caa7efcbe85526cd7602ec8ac678fd78eab Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.mm39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
index b4f2b8959e..8e565ecfe0 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
@@ -56,27 +56,21 @@
\inmodule QtWidgets
While Qt offers a lot of classes for writing your application, Apple's
- Cocoa framework offers lots of functionality that is not currently in Qt or
- may never end up in Qt. Using QMacCocoaViewContainer, it is possible to put an
- arbitrary NSView-derived class from Cocoa and put it in a Qt hierarchy.
- Depending on how comfortable you are with using objective-C, you can use
- QMacCocoaViewContainer directly, or subclass it to wrap further functionality
- of the underlying NSView.
-
- QMacCocoaViewContainer works regardless if Qt is built against Carbon or
- Cocoa. However, QCocoaContainerView requires \macos 10.5 or better to be
- used with Carbon.
-
- It should be also noted that at the low level on \macos, there is a
- difference between windows (top-levels) and view (widgets that are inside a
- window). For this reason, make sure that the NSView that you are wrapping
- doesn't end up as a top-level. The best way to ensure this is to make sure
- you always have a parent and not set the parent to 0.
-
- If you are using QMacCocoaViewContainer as a sub-class and are mixing and
- matching objective-C with C++ (a.k.a. objective-C++). It is probably
- simpler to have your file end with \tt{.mm} than \tt{.cpp}. Most Apple tools will
- correctly identify the source as objective-C++.
+ Cocoa frameworks offer functionality that is not currently available (or
+ may never end up) in Qt. Using QMacCocoaViewContainer, it is possible to take an
+ arbitrary NSView-derived class from Cocoa and put it in a Qt widgets hierarchy.
+ Depending on the level of integration you need, you can use QMacCocoaViewContainer
+ directly or subclass it to wrap more functionality of the underlying NSView.
+
+ It should be also noted that, at the Cocoa level, there is a difference
+ between top-level windows and views (widgets that are inside a window).
+ For this reason, make sure that the NSView that you are wrapping doesn't
+ end up as a top-level window. The best way to ensure this is to make sure
+ QMacCocoaViewContainer's parent widget is not null.
+
+ If you are using QMacCocoaViewContainer as a subclass and are accessing Cocoa API,
+ it is probably simpler to have your file end with \tt{.mm} instead of \tt{.cpp}.
+ Most Apple tools will correctly identify the source as Objective-C++.
QMacCocoaViewContainer requires knowledge of how Cocoa works, especially in
regard to its reference counting (retain/release) nature. It is noted in
@@ -85,7 +79,8 @@
pool. If this is done outside of a running event loop, it is up to the
developer to provide the autorelease pool.
- The following is a snippet of subclassing QMacCocoaViewContainer to wrap a NSSearchField.
+ The following is a snippet showing how to subclass QMacCocoaViewContainer
+ to wrap an NSSearchField.
\snippet macmainwindow.mm 0
*/