OSDN Git Service

Merge branch '2.3'
[qt-creator-jp/qt-creator-jp.git] / doc / qtcreator.qdoc
index d91da78..be835f5 100644 (file)
        \o \l{Getting Started}
            \list
                \o \l{Building and Running an Example Application}
-               \o \l{Creating a Qt Widget Based Application}
-               \o \l{Creating a Mobile Application with Qt SDK}
                \o \l{Creating a Qt Quick Application}
+               \o \l{Creating a Qt Quick Application Using Qt Quick Components}
+               \o \l{Creating a Qt Widget Based Application}
+               \o \l{Creating a Qt Widget Based Mobile Application}
+
            \endlist
        \o \l{Managing Projects}
             \list
     can change the information that the device has about its configuration
     and environment.
 
+    Qt Simulator does not support any device specific APIs by design. Therefore,
+    applications that run well on Qt Simulator also run on any device that hosts
+    the Qt and Qt Mobility libraries. However, this means that you cannot use
+    Qt Simulator to test applications that use device specific libraries, such
+    as Symbian C++ APIs. To test such applications, use the device emulators or
+    real devices.
+
     The Qt Simulator is installed as part of the \QSDK. After it is
     installed, you can select it as a build target in Qt Creator.
 
 
     \image qmldesigner-element-properties.png
 
-    The default values of properties are displayed in white color, while the values
-    that you specify explicitly are highlighted with blue color. In addition, property
-    changes in states are highlighted with blue.
-
     You can use a context-menu to reset some element properties. To reset the
     position or size property of an element, right-click the element and select
     \gui {Edit > Reset Position} or \gui {Reset Size} in the context menu. To
 
     For more information on the properties available for an element, press \key {F1}.
 
+    \section2 Viewing Changes in Properties
+
+    The default values of properties are displayed in white color, while the
+    values that you specify explicitly are highlighted with blue color. In
+    addition, property changes in states are highlighted with blue.
+
+    This allows you to easily see which values are set in the .qml file and
+    which values are default characteristics of an element or a component.
+
+    When editing states, you can easily see which values are explicitly set in
+    the current state and which values are derived from the base state.
+
+    The following images illustrate this. In the base state, the \gui Position,
+    \gui Size, and \gui Colors values are explicitly set and highlighted.
+
+    \image qmldesigner-properties-explicit-base.png "Explicitly set properties"
+
+    In \gui State1, only the color is explicitly set and highlighted.
+
+    \image qmldesigner-properties-explicit-state1.png "Explicitly set properties"
+
+    Resetting a property sets it back to the default value and removes the value
+    from the .qml file.
+
+    \note As a result, all boolean values can be visualized in four different
+    ways.
+
+    For example, visibility can be visualized as follows:
+
+    \table
+        \row
+            \i  \image qmldesigner-boolean-true.png
+            \i  TRUE
+            \i  The element is visible by default. The visibility might be
+                overridden by the visibility set in the base state.
+        \row
+            \i  \image qmldesigner-boolean-true-blue.png
+            \i  TRUE (highlighted)
+            \i  The element is explicitly set to visible.
+        \row
+            \i  \image qmldesigner-boolean-false.png
+            \i  FALSE
+            \i  The element is hidden by default. The visibility might be
+                overridden by the visibility set in the base state.
+        \row
+            \i  \image qmldesigner-boolean-false-blue.png
+            \i  FALSE (hightlighted)
+            \i  The item is explicitly set to hidden.
+    \endtable
+
     \section2 Setting Expressions
 
     \l{http://doc.qt.nokia.com/4.7/propertybinding.html}{Property binding}
 
 /*!
     \contentspage index.html
-    \previouspage creator-qml-application.html
+    \previouspage creator-mobile-example.html
     \page creator-project-managing.html
     \nextpage creator-project-creating.html
 
 
     \list
         \o \l{Building and Running an Example Application}
-        \o \l{Creating a Qt Widget Based Application}
-        \o \l{Creating a Mobile Application with Qt SDK}
         \o \l{Creating a Qt Quick Application}
+        \o \l{Creating a Qt Quick Application Using Qt Quick Components}
+        \o \l{Creating a Qt Widget Based Application}
+        \o \l{Creating a Qt Widget Based Mobile Application}
+
+    \endlist
+
+*/
+
+
+/*!
+    \contentspage index.html
+    \previouspage creator-qml-application.html
+    \page creator-qml-components-example.html
+    \nextpage creator-writing-program.html
+
+    \title Creating a Qt Quick Application Using Qt Quick Components
+
+    \note To complete this tutorial, you must install the Qt Quick Components
+    for Symbian and the Symbian^3 tool chain as part of the \QSDK. In addition,
+    you must install the Qt Quick Components on the test device.
+
+    This tutorial describes how to use Qt Creator to create a small Qt
+    application, Battery Status, that uses the System Information
+    Mobility API to fetch battery information from the device.
+
+    \image qtcreator-symbian-components-example.png "Mobile example"
+
+    The user interface for the application is designed using Qt Quick Components
+    for Symbian. This enforces a platform look and feel for Symbian^3 devices.
+
+    \section1 Creating the Project
+
+    \list 1
+
+        \o  Select \gui{File > New File or Project > Qt Quick Project > Qt Quick
+            Application > Choose}.
+
+        \o  In the \gui{Name} field, type \bold {BatteryStatus}.
+
+        \o  In the \gui {Create in} field, enter the path for the project files.
+            For example, \c {C:\Qt\examples}, and then click \gui{Next}.
+
+        \o  In the \gui {Application Type} dialog, select \gui {Qt Quick
+            Components (Symbian Applications)}, and then click \gui{Next}.
+
+        \o  Select \gui {Symbian Device} and \gui {Qt Simulator} targets, and
+            then click \gui{Next}.
+
+            \note Targets are listed if you installed the appropriate
+            development environment, for example, as part of the \QSDK. You can
+            add targets later in the \gui Projects mode.
+
+        \o  Select \gui Next in the following dialogs to use the default
+            settings.
+
+            \note Qt Creator contains a default program icon and generates an
+            \l{Application UID}, for testing the application on a device. You
+            only need to change the icon and UID if you deliver the application
+            for public use.
+
+        \o  Review the project settings, and click \gui{Finish} to create the
+            project.
+
+    \endlist
+
+    Qt Creator generates the necessary files that contain boiler plate code. The
+    wizard creates an application that uses
+    \l{http://doc.qt.nokia.com/qt-components-symbian-1.0/qt-components-pages-and-navigation-overview.html}
+    {page-based application navigation}.
+
+    Modify the files as described in the following sections.
+
+    \section1 Declaring the Qt Mobility API
+
+    To use the Qt Mobility APIs or develop applications for Symbian
+    devices, you must modify the .pro file to declare the Qt Mobility APIs
+    that you use.
+
+    This example uses the System Info API, so you must declare it, as
+    illustrated by the following code snippet:
+
+    \code
+
+    CONFIG += mobility
+    MOBILITY = systeminfo
+
+    \endcode
+
+    Each Mobility API has its corresponding value that you have to add
+    as a value of MOBILITY to use the API. For a list of the APIs and the
+    corresponding values that you can assign to MOBILITY, see the
+    \l {http://doc.qt.nokia.com/qtmobility/quickstart.html}{Quickstart Example}.
+
+    \section1 Adding Import Statements
+
+    The wizard adds the import statements for Qt Quick and the Qt Quick
+    Components for Symbian to the MainPage.qml file:
+
+    \code
+    import QtQuick 1.0
+    import com.nokia.symbian 1.0
+    \endcode
+
+    To use the Qt Mobility APIs, you must add the import statements for the
+    Qt Mobility APIs that you use. This example uses the System Info API, so you
+    must import it, as illustrated by the following code snippet:
+
+    \code
+    import QtMobility.systeminfo 1.1
+    \endcode
+
+    Use the values as you can assign to MOBILITY also to construct import
+    statements.
+
+    \section1 Creating the Main View
+
+    Qt Creator generates a default QML file that you can modify to create the
+    main view of the application. It displays a progress bar and a text label
+    that indicate the battery status.
+
+    \list 1
+
+        \o  Click \gui Design to open MainPage.qml in \QMLD.
+
+        \o  In the \gui Navigator pane, select the \gui Text element to edit its
+            properties in the \gui Properties pane.
+
+        \o  In the \gui Text field, change the text from \bold {Hello World!}
+            to \gui {Battery status: 1%}.
+
+        \o  In the \gui Library view, \gui Items tab, select the
+            \gui ProgressBar element, drag and drop it to the canvas, and edit
+            its properties.
+
+            \image qtcreator-symbian-components-example-ui.png "Qt Quick Components for Symbian"
+
+            \list 1
+
+                \o  Click \gui {Layout}, and then click the top anchor button.
+
+                \o  In the \gui Target field, select \gui text1, to anchor the
+                    progress bar to the bottom of the text field.
+
+                \o In the \gui Margin field, select 20.
+
+                \o  Click the horizontal anchor button, and select \gui text1 in
+                    the \gui Target field to anchor the progress bar
+                    horizontally to the text field.
+
+                \o  To check that the application can be built and run, select
+                    \gui {Qt Simulator} as the target and click the
+                    \inlineimage qtcreator-run.png
+                    button.
+
+            \endlist
+
+    \endlist
+
+    \section1 Fetching Battery Status
+
+    To fetch the battery status, open MainPage.qml in the code editor and add
+    some code to it:
+
+    \list 1
+
+        \o  Add an invisible
+            \l{http://doc.qt.nokia.com/qtmobility/qml-deviceinfo.html}
+            {DeviceInfo element} that contains two signals. The
+            \l{http://doc.qt.nokia.com/4.7/qml-component.html#onCompleted-signal}
+            {onCompleted} signal starts battery level notification when the
+            component is initialized. The
+            \l{http://doc.qt.nokia.com/qtmobility/qml-deviceinfo.html#batteryLevelChanged-signal}
+            {batteryLevelChanged} signal is called when the battery level
+            changes.
+
+            \snippet examples/batterystatus/qml/BatteryStatus/MainPage.qml 0
+
+        \o  Set an expression as the value of the text property of the Text
+            element to display the battery level as a percentage:
+
+            \snippet examples/batterystatus/qml/BatteryStatus/MainPage.qml 1
+
+        \o  Set values for the ProgressBar element to display the battery level
+            on the progress bar:
+
+            \snippet examples/batterystatus/qml/BatteryStatus/MainPage.qml 2
+
+    \endlist
+
+
+    \section1 Compiling and Running Your Program
+
+    Now that you have all the necessary code, select \gui {Qt Simulator}
+    as the target and click the
+    \inlineimage qtcreator-run.png
+    button to build your program and run it in the Qt Simulator.
+
+    In Qt Simulator, run the runOutOfBattery.qs example script
+    to see the value change in the Battery Indicator application.
+    Select \gui {Scripting > examples > runOutOfBattery.qs > Run}.
+
+    \image qtcreator-symbian-components-example-simulated.png "Mobile example in Qt Simulator"
+
+    \section1 Testing on a Symbian Device
+
+    You also need to test the application on real devices. Before you can
+    start testing on Symbian devices, you must connect them to the development
+    PC by using a USB cable and install the necessary software on them.
+
+    \list 1
+
+        \o  Install Qt libraries, Qt mobile libraries, Qt Quick components for
+            Symbian, and a debugging agent on the device. For more information,
+            see \l{Connecting Symbian Devices}.
+
+        \o  Start the CODA debugging agent on the device.
+
+        \o  Click the \gui {Target Selector} and select \gui {Symbian Device}.
+
+        \o  Click \gui Run to build the application for the Symbian device.
+
     \endlist
 
 */
     \contentspage index.html
     \previouspage creator-writing-program.html
     \page creator-mobile-example.html
-    \nextpage creator-qml-application.html
+    \nextpage creator-project-managing.html
 
-    \title Creating a Mobile Application with Qt SDK
+    \title Creating a Qt Widget Based Mobile Application
 
     \note To complete this tutorial, you must install \QSDK.
     The installation program installs and configures the necessary tool chains
     application, Battery Indicator, that uses the System Information
     Mobility API to fetch battery information from the device.
 
+    The user interface for the application is designed using Qt widgets. This
+    enforces a platform look and feel for Symbian devices and Maemo 5 devices.
+    However, to achieve a platform look and feel for MeeGo Harmattan devices,
+    \l{Creating Qt Quick Applications}{create a Qt Quick Application} and use
+    the Qt Quick components for MeeGo.
+
     \image qtcreator-batteryindicator-screenshot.png
 
     \section1 Creating the Battery Indicator Project
     \contentspage index.html
     \previouspage creator-getting-started.html
     \page creator-build-example-application.html
-    \nextpage creator-writing-program.html
+    \nextpage creator-qml-application.html
 
     \title Building and Running an Example Application
 
 
 /*!
     \contentspage index.html
-    \previouspage creator-mobile-example.html
+    \previouspage creator-build-example-application.html
     \page creator-qml-application.html
-    \nextpage creator-project-managing.html
+    \nextpage creator-qml-components-example.html
 
     \title Creating a Qt Quick Application
 
 
 /*!
     \contentspage index.html
-    \previouspage creator-build-example-application.html
+    \previouspage creator-qml-components-example.html
     \page creator-writing-program.html
     \nextpage creator-mobile-example.html
 
     Symbol Server provided by Microsoft to the symbol search path of the debugger.
     For more information, see \l{Setting the Symbol Server in Windows}.
 
+    \note To use the Free Software Foundation (FSF) GDB on Mac OS, you must
+    sign it and add it to Qt Creator as a tool chain.
+
     This section explains the
     options you have for debugging C++ code and provides installation notes for the
     supported native debuggers.
     \section1 Supported Native Debugger Versions
 
     The debugger plugin supports different builds of the GDB debugger, both
-    with and without the ability to use Python scripting. The Python enabled
-    versions are preferred, but they are not available on Mac and on older
-    versions of Linux.
+    with and without the ability to use Python scripting. Use a Python enabled
+    version if one is available.
     On Windows, Symbian, Maemo, and MeeGo Harmattan, only the Python version is
     supported.
 
             \o Yes
             \o Plain, Terminal, Attach, Remote, Core
         \row
-            \o Mac OS
+            \o Mac OS/GDB
             \o GCC
             \o GDB
             \o No
             \o Plain, Terminal, Attach, Core
         \row
+            \o Mac OS/FSF GDB (experimental)
+            \o GCC
+            \o FSF GDB
+            \o Yes
+            \o Plain, Terminal, Attach, Core
+        \row
             \o Windows/MinGW
             \o GCC
             \o GDB
            \o The Qt binary distribution contains both debug and release
               variants of the libraries. But you have to explicitly tell the
               runtime linker that you want to use the debug libraries even if
-              your application is compiled as debug as release is the default
+              your application is compiled as debug, as release is the default
               library.
 
               If you use a qmake based project in Qt Creator,  you can set a
               configuration, select \gui{Use debug version of frameworks}.
 
               For more detailed information about debugging on the Mac OS X, see:
-              \l{http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html}{Mac OS X Debugging Magic}.
+              \l{http://developer.apple.com/library/mac/#technotes/tn2124/_index.html#//apple_ref/doc/uid/DTS10003391}
+              {Mac OS X Debugging Magic}.
 
-        \note The Mac OS X Snow Leopard (10.6) has a bug that might cause the
+              You can download an experimental version of FSF GDB that
+              supports Python from
+              \l{ftp://ftp.qt.nokia.com/misc/gdb/7.2/gdb72_mac_platform.tar.bz2}.
+              To use FSF GDB on Mac OS, you must sign it and add it to the Qt
+              Creator tool chains. For more information, see
+              \l{Setting up FSF GDB for Mac OS}.
+
+              \note The Mac OS X Snow Leopard (10.6) has a bug that might cause the
               application to crash. For a workaround, see:
               \l{http://bugreports.qt.nokia.com/browse/QTBUG-4962}{QTBUG-4962}.
 
     Debugging tools for Windows, Qt Creator prompts you to add the Symbol
     Server.
 
+    \section1 Setting up FSF GDB for Mac OS
+
+    To use FSF GDB on Mac OS, you must sign it and add it to the Qt Creator tool
+    chains.
+
+    \list 1
+
+        \o  To create a key for signing FSF GDB, select \gui {Keychain Access >
+            Certificate Assistant > Create a Certificate}:
+
+        \list 1
+
+            \o  In the \gui {Certificate Type} field, select \gui {Code Signing}.
+
+            \o  Select the \gui {Let me override defaults} check box.
+
+            \o  Select \gui Continue, and follow the instructions of the
+                wizard (use the default settings), until the \gui {Select a
+                Location for the Certificate} dialog opens.
+
+            \o  In the \gui Keychain field, select \gui System.
+
+            \o  Select \gui {Keychain Access > System}, and locate the
+                certificate.
+
+            \o  Double click the certificate to view certificate information.
+
+            \o  In the \gui Trust field, select \gui {Always Trust}.
+
+        \endlist
+
+        \o  To sign the binary, enter the following command in the terminal,
+            where $USER is the name of the certificate (which is the same as the
+            user name, by default):
+
+            \code
+            codesign -f -s "$USER" $INSTALL_LOCATION/fsfgdb
+            \endcode
+
+        \o  In Qt Creator, select \gui {Tools > Preferences\85 > Tool Chains}, to
+            add a tool chain that uses the debugger:
+
+        \list 1
+
+            \o  Select a native tool chain (usually, a x86 64-bit tool chain)
+                and click \gui Clone to clone it.
+
+            \o  In the \gui Debugger field, specify the path to FSF GDB
+                (\c $HOME/gdb72/bin/fsfgdb, but with an explicit value for
+                \c $HOME).
+
+        \endlist
+
+        \o  To use the debugger, select the tool chain in the \gui {Tool chain}
+            field in the \gui {Build Settings} of the project.
+
+    \endlist
+
 */
 
 /*!
     \note You need Qt 4.7.1 or later to debug Qt Quick projects. Debugging projects
     not created with the Qt Quick wizards is only supported with Qt 4.8, or later.
 
+    To debug Qt Quick applications running on devices, you must install
+    Qt 4.7.4, or later, libraries on devices. To debug applications on Symbian
+    devices, you must install also QML Viewer on them.
+
     \section1 Setting Up QML Debugging
 
     The process of setting up debugging for Qt Quick projects depends on the type of
 
     \endlist
 
+    To debug Qt Quick Applications on devices, install Qt 4.7.4, or later,
+    libraries on devices. Then select the device as the target before you
+    start debugging.
+
     \section1 Starting QML Debugging
 
     To start the application, choose \gui {Debug > Start Debugging