Build QML Box2D Library: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
# Download <span class="caps">QML</span>-Box2d source from this link [https://gitorious.org/qml-box2d Gitorious <span class="caps">QML</span> Box2D.] ''[gitorious.org]''
# Download QML-Box2d source from this link &quot;Gitorious QML Box2D.&quot;:https://gitorious.org/qml-box2d<br /># Move it to '''&lt;Path to QtSDK&amp;gt;&lt;version&amp;gt;lt;gcc(or)mingw&amp;gt;, if you want to build Box2D applications for Desktop. For example this path was like this in my desktop''' /home/&amp;lt;my_user_name&amp;gt;/QtSDK/Desktop/Qt/4.8.1/gcc/imports*. If you want to develop it for other platform, such as Symbian, move it to *&lt;Path to QtSDK&amp;gt;&lt;version&amp;gt;.<br /># Now extract the compressed file and rename the folder as '''Box2D'''.<br />'''''' If you look into the imports folder you will notice that the folders are named as we use it in the '''import''' statement. For eg. '''import''' '''Qt.labs.folderlistmodel 1.0'''.<br />'''''' Look at the appropriate case as in the folder names.<br />'''''' Also notice there is no '''libBox2D.so''' file, that is the file which we are going to build.<br /># Now open Qt creator.<br /># Select File -&gt; Open Project.<br /># Move to the Box2d in the open project dialogue box and select the '''box2d.pro''' file.<br /># Now the Qt creator will open the project, in the same way it opens any other Qt project.<br /># Now select '''Projects''' in the left pane and select '''Build''' on the top.<br /># Under the Qt Version select appropriate Qt version such as '''Desktop Qt &lt;version&amp;gt; for GCC (Qt SDK) Release'''.<br /># Now select '''Edit''' on the left pane and select '''Build'''.<br /># This will build your Box2D plugin for QML.<br /># Now goto the Box2D source folder (the one you downloaded and building) and look. There will be a '''libBox2D.so''' file.<br /># This means you can use Box2D in your QML projects like using any other plugin,for e.g. '''FolderListModel'''.<br /># Explore the projects in Box2D '''examples''' folder. You can run the examples using command '''qmlviewer example_folder_name.qml'''.
# Move it to '''&lt;Path to QtSDK&gt;\Desktop\Qt\Qt&lt;version&gt;\&lt;gcc(or)mingw&gt;\imports''', if you want to build Box2D applications for Desktop. For example this path was like this in my desktop* /home/&lt;my_user_name&gt;/QtSDK/Desktop/Qt/4.8.1/gcc/imports*. If you want to develop it for other platform, such as Symbian, move it to '''&lt;Path to QtSDK&gt;\QtSources\Qt&lt;version&gt;\imports'''.
# Now extract the compressed file and rename the folder as '''Box2D'''.
#* If you look into the imports folder you will notice that the folders are named as we use it in the '''import''' statement. For eg. '''import''' '''Qt.labs.folderlistmodel 1.0'''.
#* Look at the appropriate case as in the folder names.
#* Also notice there is no '''libBox2D.so''' file, that is the file which we are going to build.
# Now open Qt creator.
# Select File -&gt; Open Project.
# Move to the Box2d in the open project dialogue box and select the '''box2d.pro''' file.
# Now the Qt creator will open the project, in the same way it opens any other Qt project.
# Now select '''Projects''' in the left pane and select '''Build''' on the top.
# Under the Qt Version select appropriate Qt version such as '''Desktop Qt &lt;version&gt; for <span class="caps">GCC</span> Release'''.
# Now select '''Edit''' on the left pane and select '''Build'''.
# This will build your Box2D plugin for <span class="caps">QML</span>.
# Now goto the Box2D source folder (the one you downloaded and building) and look. There will be a '''libBox2D.so''' file.
# This means you can use Box2D in your <span class="caps">QML</span> projects like using any other plugin,for e.g. '''FolderListModel'''.
# Explore the projects in Box2D '''examples''' folder. You can run the examples using command '''qmlviewer example_folder_name.qml'''.


==Side Note:==
== Side Note: ==
 
This guide is demonstrated using Ubuntu operating system. So this page contains Linux specific things like ''Folder Path'', library file name like ''libBox2D.so''. So it may differ with your target operating system for which you are building this library. For e.g. in Windows the built library file will have the file extension ''.dll''.

Revision as of 09:44, 24 February 2015

  1. Download QML-Box2d source from this link "Gitorious QML Box2D.":https://gitorious.org/qml-box2d
    # Move it to <Path to QtSDK&gt;<version&gt;lt;gcc(or)mingw&gt;, if you want to build Box2D applications for Desktop. For example this path was like this in my desktop' /home/&lt;my_user_name&gt;/QtSDK/Desktop/Qt/4.8.1/gcc/imports*. If you want to develop it for other platform, such as Symbian, move it to *<Path to QtSDK&gt;<version&gt;.
    # Now extract the compressed file and rename the folder as
    Box2D.
    '
    If you look into the imports folder you will notice that the folders are named as we use it in the import statement. For eg. import Qt.labs.folderlistmodel 1.0.
    ' Look at the appropriate case as in the folder names.
    '
    Also notice there is no libBox2D.so file, that is the file which we are going to build.
    # Now open Qt creator.
    # Select File -> Open Project.
    # Move to the Box2d in the open project dialogue box and select the box2d.pro file.
    # Now the Qt creator will open the project, in the same way it opens any other Qt project.
    # Now select Projects in the left pane and select Build on the top.
    # Under the Qt Version select appropriate Qt version such as Desktop Qt <version&gt; for GCC (Qt SDK) Release.
    # Now select Edit on the left pane and select Build.
    # This will build your Box2D plugin for QML.
    # Now goto the Box2D source folder (the one you downloaded and building) and look. There will be a libBox2D.so file.
    # This means you can use Box2D in your QML projects like using any other plugin,for e.g. FolderListModel.
    # Explore the projects in Box2D examples folder. You can run the examples using command qmlviewer example_folder_name.qml.

Side Note: