| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information (qt-info@nokia.com)
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the documentation of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** package.
|
|---|
| 27 | **
|
|---|
| 28 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at qt-sales@nokia.com.
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | /****************************************************************************
|
|---|
| 43 | **
|
|---|
| 44 | ** Qt for Mac OS X documentation
|
|---|
| 45 | **
|
|---|
| 46 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 47 | ** Contact: Qt Software Information (qt-info@nokia.com)
|
|---|
| 48 | **
|
|---|
| 49 | ** This file is part of the Qt Toolkit.
|
|---|
| 50 | **
|
|---|
| 51 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 52 | ** Commercial Usage
|
|---|
| 53 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 54 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 55 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 56 | ** a written agreement between you and Nokia.
|
|---|
| 57 | **
|
|---|
| 58 | ** GNU Lesser General Public License Usage
|
|---|
| 59 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 60 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 61 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 62 | ** packaging of this file. Please review the following information to
|
|---|
| 63 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 64 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 65 | **
|
|---|
| 66 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 67 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 68 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 69 | ** package.
|
|---|
| 70 | **
|
|---|
| 71 | ** GNU General Public License Usage
|
|---|
| 72 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 73 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 74 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 75 | ** packaging of this file. Please review the following information to
|
|---|
| 76 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 77 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 78 | **
|
|---|
| 79 | ** If you are unsure which license is appropriate for your use, please
|
|---|
| 80 | ** contact the sales department at qt-sales@nokia.com.
|
|---|
| 81 | ** $QT_END_LICENSE$
|
|---|
| 82 | **
|
|---|
| 83 | **********************************************************************/
|
|---|
| 84 |
|
|---|
| 85 | /*!
|
|---|
| 86 | \page qtmac-as-native.html
|
|---|
| 87 | \title Qt is Mac OS X Native
|
|---|
| 88 | \brief An explanation of Qt's native features on Mac OS X.
|
|---|
| 89 | \ingroup platform-notes
|
|---|
| 90 |
|
|---|
| 91 | This document explains what makes an application native on Mac OS X.
|
|---|
| 92 | It shows the areas where Qt is compliant, and the grey areas where
|
|---|
| 93 | compliance is more questionable. (See also the document
|
|---|
| 94 | \l{mac-differences.html}{Qt for Mac OS X - Specific Issues}.)
|
|---|
| 95 |
|
|---|
| 96 | Normally when referring to a native Mac application, one really means an
|
|---|
| 97 | application that talks directly to the underlying window system, rather
|
|---|
| 98 | than one that uses some intermediary (for example Apple's X11 server, or a
|
|---|
| 99 | web browser). Qt applications run as first class citizens, just like
|
|---|
| 100 | Cocoa, and Carbon applications. In fact, we use Carbon and HIView
|
|---|
| 101 | internally to communicate with OS X.
|
|---|
| 102 |
|
|---|
| 103 | When an application is running as a first class citizen, it means that
|
|---|
| 104 | it can interact with specific components of the Mac OS X experience:
|
|---|
| 105 |
|
|---|
| 106 | \tableofcontents
|
|---|
| 107 |
|
|---|
| 108 | \section1 The Global Menu Bar
|
|---|
| 109 |
|
|---|
| 110 | Qt does this via the QMenuBar abstraction. Mac users expect to
|
|---|
| 111 | have a menu bar at the top of the screen and Qt honors this.
|
|---|
| 112 |
|
|---|
| 113 | Additionally, users expect certain conventions to be respected, for
|
|---|
| 114 | example the application menu should contain About, Preferences,
|
|---|
| 115 | Quit, etc. Qt handles this automatically, although it does not
|
|---|
| 116 | provide a means of interacting directly with the application menu.
|
|---|
| 117 | (By doing this automatically, Qt makes it easier to port Qt
|
|---|
| 118 | applications to other platforms.)
|
|---|
| 119 |
|
|---|
| 120 | \section1 Aqua
|
|---|
| 121 |
|
|---|
| 122 | This is a critical piece of Mac OS X (documentation can be found at
|
|---|
| 123 | \l{http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html}).
|
|---|
| 124 | It is a huge topic, but the most important guidelines for GUI
|
|---|
| 125 | design are probably these:
|
|---|
| 126 |
|
|---|
| 127 | \list
|
|---|
| 128 | \i \e{Aqua look}
|
|---|
| 129 |
|
|---|
| 130 | As with Cocoa/Carbon, Qt provides widgets that look like those
|
|---|
| 131 | described in the Human Interface Descriptions. Qt's widgets use
|
|---|
| 132 | Appearance Manager on Mac OS X 10.2 and the new HIThemes on Mac OS X 10.3
|
|---|
| 133 | and higher to implement the look, in other words we use Apple's own API's
|
|---|
| 134 | for doing the rendering.
|
|---|
| 135 |
|
|---|
| 136 | \i \e{Aqua feel}
|
|---|
| 137 |
|
|---|
| 138 | This is a bit more subjective, but certainly Qt strives to
|
|---|
| 139 | provide the same feel as any Mac OS X application (and we
|
|---|
| 140 | consider situations where it doesn't achieve this to be bugs).
|
|---|
| 141 | Of course Qt has other concerns to bear in mind, especially
|
|---|
| 142 | remaining cross-platform. Some "baggage" that Qt carries is in
|
|---|
| 143 | an effort to provide a widget on a platform for which an
|
|---|
| 144 | equivelant doesn't exist, or so that a single API can be used to
|
|---|
| 145 | do something, even if the API doesn't make entire sense for a
|
|---|
| 146 | specific widget.
|
|---|
| 147 |
|
|---|
| 148 | \i \e{Aqua guides}
|
|---|
| 149 |
|
|---|
| 150 | This is the most subjective, but there are many suggestions and
|
|---|
| 151 | guidelines in the Aqua style guidelines. This is the area where Qt is
|
|---|
| 152 | of least assistance. The decisions that must be made to conform (widget
|
|---|
| 153 | sizes, widget layouts with respect to other widgets, window margins,
|
|---|
| 154 | placement of OK and Cancel, etc) must be made based on the user
|
|---|
| 155 | experience demanded by your application. If your user base is small or
|
|---|
| 156 | mostly comes from the Windows or Unix worlds, these are minor issues much
|
|---|
| 157 | less important than trying to make a mass market product. Qt for Mac OS X
|
|---|
| 158 | is fully API compatible with Qt for Windows and X11, but Mac OS X is a
|
|---|
| 159 | significantly different platform to Windows and some special
|
|---|
| 160 | considerations must be made based on your audience.
|
|---|
| 161 |
|
|---|
| 162 | \endlist
|
|---|
| 163 |
|
|---|
| 164 | \section1 Dock
|
|---|
| 165 |
|
|---|
| 166 | Interaction with the dock is possible. The icon can be set by calling
|
|---|
| 167 | QWidget::setWindowIcon() on the main window in your application. The
|
|---|
| 168 | setWindowIcon() call can be made as often as necessary, providing an
|
|---|
| 169 | icon that can be easily updated.
|
|---|
| 170 | \omit
|
|---|
| 171 | It is also possible to set a QMenu as the dock menu through the use of the
|
|---|
| 172 | qt_mac_set_dock_menu() function.
|
|---|
| 173 | \endomit
|
|---|
| 174 |
|
|---|
| 175 | \section1 Accessiblity
|
|---|
| 176 |
|
|---|
| 177 | Although many users never use this, some users will only interact with your
|
|---|
| 178 | applications via assistive devices. With Qt the aim is to make this
|
|---|
| 179 | automatic in your application so that it conforms to accepted practice on
|
|---|
| 180 | its platform. Qt uses Apple's accessibility framework to provide access
|
|---|
| 181 | to users with diabilities.
|
|---|
| 182 |
|
|---|
| 183 | \section1 Development Tools
|
|---|
| 184 |
|
|---|
| 185 | Mac OS X developers expect a certain level of interopability
|
|---|
| 186 | between their development toolkit and the platform's developer
|
|---|
| 187 | tools (for example Visual Studio, gmake, etc). Qt supports both Unix
|
|---|
| 188 | style Makefiles, and ProjectBuilder/Xcode project files by using
|
|---|
| 189 | the \l qmake tool. For example:
|
|---|
| 190 |
|
|---|
| 191 | \snippet doc/src/snippets/code/doc_src_qtmac-as-native.qdoc 0
|
|---|
| 192 |
|
|---|
| 193 | will generate an Xcode project file from project.pro. With \l qmake
|
|---|
| 194 | you do not have to worry about rules for Qt's preprocessors (\l moc
|
|---|
| 195 | and \l uic) since \l qmake automatically handles them and ensures that
|
|---|
| 196 | everything necessary is linked into your application.
|
|---|
| 197 |
|
|---|
| 198 | Qt does not entirely interact with the development environment (for
|
|---|
| 199 | example plugins to set a file to "mocable" from within the Xcode
|
|---|
| 200 | user interface). Nokia is actively working on improving Qt's
|
|---|
| 201 | interoperability with various IDEs.
|
|---|
| 202 | */
|
|---|