Creating Hello World Application for Tizen: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
This article describes how to make a ''Qt Hello World'' application for Tizen emulator. For actual Tizen device the steps are the same.
This article describes how to make a ''Qt Hello World'' application for Tizen emulator. For actual Tizen device the steps are the same.


==Assumptions==
== Assumptions ==


* prepared development environment according to [[Build-Qt-for-Tizen|build howto]] ''[qt.io]''
* prepared development environment according to "build howto":http://wiki.qt.io/Build-Qt-for-Tizen  
* basic knowledge about [https://developer.tizen.org/help/index.jsp?topic=/org.tizen.native.appprogramming/html/app_dev_process/packaging_app.htm Tizen tpk structure] ''[developer.tizen.org]''
* basic knowledge about "Tizen tpk structure":https://developer.tizen.org/help/index.jsp?topic=/org.tizen.native.appprogramming/html/app_dev_process/packaging_app.htm  


==Steps==
== Steps ==


# See hello world example from [https://qt.gitorious.org/qt/qtquickcontrols-tizen qtquickcontrols-tizen] ''[qt.gitorious.org]'' wip/tizen branch<br />
# See hello world example from &quot;qtquickcontrols-tizen&amp;quot;:https://qt.gitorious.org/qt/qtquickcontrols-tizen wip/tizen branch<br /><code>git clone <s>b wip/tizen https://git.gitorious.org/qt/qtquickcontrols-tizen.git<code><br /># Create your own application as you would develop for desktop<br /># Create tizen subdirectory and copy there manifest.xml file from helloworld example in qtquickcontrols-tizen repository.<br /># Also copy ''shared'' folder from helloworld example in qtquickcontrols-tizen repository. It contains default application icon. Path to this icon is already set in manifest.xml.<br /># Choose application name and new Application ID from manifest editor in QtCreator(double click on manifest file in project explorer).<br /># adapt application's project pro file for tizen with tizen scope:<br /></code>tizen {<br /> tizen_shared.files = shared/res<br /> CONFIG ''= TIZEN_STANDALONE_PACKAGE<br /> TIZEN_BUNDLED_QT_LIBS=Qt5Core Qt5DBus Qt5Qml Qt5Quick Qt5Widgets Qt5Gui Qt5Network<br /> load(tizen_app)<br />}<br /><code><br /># adapt application's main.cpp file by adding OspMain function:<br /></code>extern &quot;C&amp;quot; int OspMain(int argc, char '''argv[])<br />{<br /> return main(argc, argv);<br />}<br /><code><br /># Now compile and deploy from QtCreator. You application should appear in homescreen on emulator or device (depending on Kit, you chose)
# Create your own application as you would develop for desktop
<br />h2. Additional explanation
# Create tizen subdirectory and copy there manifest.xml file from helloworld example in qtquickcontrols-tizen repository.
<br />Qmake Variables<br />''' CONFIG''= TIZEN_STANDALONE_PACKAGE</s> Qt libraries listed in TIZEN_BUNDLED_QT_LIBS will be copied to package lib subdirectory. Additionally Qt plugins will be copied from $$[QT_INSTALL_PLUGINS] to data/plugins package subdirectory and qml plugins from $$[QT_INSTALL_QML] to data/qml package subdirectory.
# Also copy ''shared'' folder from helloworld example in qtquickcontrols-tizen repository. It contains default application icon. Path to this icon is already set in manifest.xml.
# Choose application name and new Application ID from manifest editor in QtCreator(double click on manifest file in project explorer).
# adapt application’s project pro file for tizen with tizen scope:<br />
# adapt application’s main.cpp file by adding OspMain function:<br />
# Now compile and deploy from QtCreator. You application should appear in homescreen on emulator or device (depending on Kit, you chose)


==Additional explanation==
* tizen_shared.files - flies which will be copied to application package shared subdirectory. There are also qmake variables for other directories:
 
Qmake Variables
 
* <span class="caps">CONFIG</span> += <span class="caps">TIZEN</span>_STANDALONE_PACKAGE – Qt libraries listed in <span class="caps">TIZEN</span>_BUNDLED_QT_LIBS will be copied to package lib subdirectory. Additionally Qt plugins will be copied from $$[QT_INSTALL_PLUGINS] to data/plugins package subdirectory and qml plugins from $$[QT_INSTALL_QML] to data/qml package subdirectory.
 
* tizen_shared.files flies which will be copied to application package shared subdirectory. There are also qmake variables for other directories:
** tizen_bin
** tizen_bin
** tizen_data
** tizen_data
Line 30: Line 19:
** tizen_res
** tizen_res
** tizen_setting
** tizen_setting
===Categories:===
* [[:Category:Developing Qt|Developing_Qt]]
** [[:Category:Developing Qt::Ports|Ports]]
* [[:Category:Developing Qt::Ports::Tizen|Tizen]]

Revision as of 09:24, 24 February 2015

This article describes how to make a Qt Hello World application for Tizen emulator. For actual Tizen device the steps are the same.

Assumptions

Steps

  1. See hello world example from "qtquickcontrols-tizen&quot;:https://qt.gitorious.org/qt/qtquickcontrols-tizen wip/tizen branch
    git clone <s>b wip/tizen https://git.gitorious.org/qt/qtquickcontrols-tizen.git<code><br /># Create your own application as you would develop for desktop<br /># Create tizen subdirectory and copy there manifest.xml file from helloworld example in qtquickcontrols-tizen repository.<br /># Also copy ''shared'' folder from helloworld example in qtquickcontrols-tizen repository. It contains default application icon. Path to this icon is already set in manifest.xml.<br /># Choose application name and new Application ID from manifest editor in QtCreator(double click on manifest file in project explorer).<br /># adapt application's project pro file for tizen with tizen scope:<br />
    
    tizen {
    tizen_shared.files = shared/res
    CONFIG = TIZEN_STANDALONE_PACKAGE
    TIZEN_BUNDLED_QT_LIBS=Qt5Core Qt5DBus Qt5Qml Qt5Quick Qt5Widgets Qt5Gui Qt5Network
    load(tizen_app)
    }
    <br /># adapt application's main.cpp file by adding OspMain function:<br />
    
    extern "C&quot; int OspMain(int argc, char '
    argv[])
    {
    return main(argc, argv);
    }

    # Now compile and deploy from QtCreator. You application should appear in homescreen on emulator or device (depending on Kit, you chose)


h2. Additional explanation
Qmake Variables
' CONFIG= TIZEN_STANDALONE_PACKAGE Qt libraries listed in TIZEN_BUNDLED_QT_LIBS will be copied to package lib subdirectory. Additionally Qt plugins will be copied from $$[QT_INSTALL_PLUGINS] to data/plugins package subdirectory and qml plugins from $$[QT_INSTALL_QML] to data/qml package subdirectory.

  • tizen_shared.files - flies which will be copied to application package shared subdirectory. There are also qmake variables for other directories:
    • tizen_bin
    • tizen_data
    • tizen_info
    • tizen_lib
    • tizen_res
    • tizen_setting