Create Qt on Raspberry Pi: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Qt on Raspberry Pi — Create=
[[Category:QtonPi]]<br />[toc align_right=&quot;yes&amp;quot; depth=&quot;2&amp;quot;]


==QtonPi App <span class="caps">SDK</span>==
= Qt on Raspberry Pi — Create =


QtonPi Release-0.x App <span class="caps">SDK</span> consists of,
== QtonPi App SDK ==
 
QtonPi Release-0.x App SDK consists of,


* Qt Creator
* Qt Creator
* Sysroot + Toolchain
* Sysroot + Toolchain


As indicated in the [[Contribute|roadmap]], we hope to have a more integrated App <span class="caps">SDK</span> from Release-1.x onwards.
As indicated in the [[Contribute | roadmap]], we hope to have a more integrated App SDK from Release-1.x onwards.


==Download==
== Download ==


QtonPi releases are distributed via BitTorrent. QtonPi download page is [[Download|here]].
QtonPi releases are distributed via BitTorrent. QtonPi download page is [[Download | here]].


Upon downloading a QtonPi release, you should see a tarball <code>qtonpi-X.Y.tar.bz2</code>, where <code>“X”</code> is the major release number and <code>“Y”</code> is the minor release.
Upon downloading a QtonPi release, you should see a tarball &lt;code&amp;gt;qtonpi-X.Y.tar.bz2&amp;lt;/code&amp;gt;, where &lt;code&amp;gt;&quot;X&amp;quot;&lt;/code&amp;gt; is the major release number and &lt;code&amp;gt;&quot;Y&amp;quot;&lt;/code&amp;gt; is the minor release.


QtonPi release directory is organized as follows,
QtonPi release directory is organized as follows,
<code><br />qtonpi-X.Y/<br />├── app-sdk/<br />├── platform-sdk/<br />│ ├── host-rpms/<br />│ ├── image-creator-binaries/<br />│ └── mt-cross-tools/<br />└── sdcard-img/<br /></code>


Following is a brief description of the directory structure,
Following is a brief description of the directory structure,


{| class="infotable line"
{|
| <code>app-sdk/</code>
|&lt;code&amp;gt;app-sdk/&amp;lt;/code&amp;gt;
| Application <span class="caps">SDK</span>
|Application SDK
|-
|-
| <code>platform-sdk/</code>
|&lt;code&amp;gt;platform-sdk/&amp;lt;/code&amp;gt;
|
|''Platform SDK - In case you would like to roll your own SD Card Image and/or Sysroot. See [[Contribute
‘‘Platform <span class="caps">SDK</span> – In case you would like to roll your own SD Card Image and/or Sysroot. See [[Contribute]] section for more details’‘
|-
|-
| <code>sdcard-img/</code>
|&lt;code&amp;gt;sdcard-img/&amp;lt;/code&amp;gt;
| ‘‘Default SD Card Image Please use this for reporting bugs!’‘
|''Default SD Card Image - Please use this for reporting bugs!''
|}
|}


==Install==
== Install ==
 
=== Qt Creator ===
 
First step would be to install Qt Creator. You will find Qt Creator installer here, '''<span class="Sysroot_ and _Toolchain from instructions the follow and Creator Qt current your use Just installed. SDK Qt updated an have you if necessary not is This Note:"></span>'''


===Qt Creator===
<code><br />qtonpi-X.Y/<br />├── app-sdk/<br />│ └── qt-creator-linux-x86-opensource-2.x.y.bin<br /></code>


First step would be to install Qt Creator. You will find Qt Creator installer here, '''(Note: This is not necessary if you have an updated Qt <span class="caps">SDK</span> installed. Just use your current Qt Creator and follow the instructions from ''Toolchain and Sysroot'')'''
To install, just run the &lt;code&amp;gt;qt-creator-linux-x86-opensource-2.x.y.bin&amp;lt;/code&amp;gt; file


To install, just run the <code>qt-creator-linux-x86-opensource-2.x.y.bin</code> file
<code><br />$ pwd<br />/home/rajiv/qtonpi-0.2/app-sdk<br />$ ./qt-creator-linux-x86-opensource-2.4.1.bin<br /></code>


This should install, launch Qt Creator. In addition, it’ll also create an icon on your Desktop.
This should install, launch Qt Creator. In addition, it'll also create an icon on your Desktop.


===Toolchain and Sysroot===
=== Toolchain and Sysroot ===


Next step would be to install the toolchain and default sysroot. You can find it here,
Next step would be to install the toolchain and default sysroot. You can find it here,


You will need to extract this as <code>root</code> user, into the <code>root(/)</code> directory of your filesystem.
<code><br />qtonpi-X.Y/<br />├── app-sdk/<br />│ └── toolchain-and-sysroot-armv5tel.tar.bz2<br /></code>
 
You will need to extract this as &lt;code&amp;gt;root&amp;lt;/code&amp;gt; user, into the &lt;code&amp;gt;root(&quot;/&amp;quot;)&lt;/code&amp;gt; directory of your filesystem.
 
<code><br />$ cd /<br />$ pwd<br />/<br />$ sudo tar jxvf /home/rajiv/qtonpi-0.2/app-sdk/toolchain-and-sysroot-armv5tel.tar.bz2<br /></code>
 
=== Qt 5 ===
 
QtonPi ships with a known working (necessarily not stable!) version of Qt 5. This version works both on the sysroot and the target and you can find it here, '''<span class="release 1.x the in resolved be should This development. x86 for installed Qt5 have already you if instance For install. Qt5 another with nicely play not does This Note:"></span>'''
 
<code><br />qtonpi-0.2/<br />├── app-sdk/<br />│ ├── opt-qt5-current.tar.bz2<br /></code>
 
You will need to extract this as &lt;code&amp;gt;root&amp;lt;/code&amp;gt; user, into the &lt;code&amp;gt;root(&quot;/&amp;quot;)&lt;/code&amp;gt; directory of your filesystem.


===Qt 5===
<code><br />$ cd /<br />$ pwd<br />/<br />$ sudo tar jxvf /home/rajiv/qtonpi-0.2/app-sdk/opt-qt5-current.tar.bz2<br /></code>


QtonPi ships with a known working (necessarily not stable!) version of Qt 5. This version works both on the sysroot and the target and you can find it here, '''(Note: This does not play nicely with another Qt5 install. For instance if you already have Qt5 installed for x86 development. This should be resolved in the 1.x release)'''
=== SD Card Image ===


You will need to extract this as <code>root</code> user, into the <code>root(”/”)</code> directory of your filesystem.
In addition, there is also a default 2GB SD Card Image, with Qt 5 on it. You'll find it here.


===SD Card Image===
<code><br />qtonpi-X.Y/<br />└── sdcard-img/<br /> └── qtonpi-sdcard-X.Y.img.bz2<br /></code>


In addition, there is also a default 2GB SD Card Image, with Qt 5 on it. You’ll find it here.
To setup your SD card, &lt;code&amp;gt;cat/dd&amp;lt;/code&amp;gt; the contents of this file onto your SD Card. Assuming your SD Card device is &lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;, one way to do this is as follows. Note you'll need to be logged in as &lt;code&amp;gt;root&amp;lt;/code&amp;gt; in order to be able to write to &lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; device.


To setup your SD card, <code>cat/dd</code> the contents of this file onto your SD Card. Assuming your SD Card device is <code>/dev/sdb</code>, one way to do this is as follows. Note you’ll need to be logged in as <code>root</code> in order to be able to write to <code>/dev/sdb</code> device.
<code><br /># pwd<br />/home/rajiv/qtonpi-0.2/sdcard-img<br /># bzcat qtonpi-sdcard-0.2.img.bz2 &gt; /dev/sdb; sync<br /></code>


You’re now ready to boot your Raspberry Pi Device! There are two accounts – <code>root</code> and <code>qtonpi</code>. Password for the accounts are <code>rootme</code> and <code>qtonpi</code> respectively.
You're now ready to boot your Raspberry Pi Device! There are two accounts - &lt;code&amp;gt;root&amp;lt;/code&amp;gt; and &lt;code&amp;gt;qtonpi&amp;lt;/code&amp;gt;. Password for the accounts are &lt;code&amp;gt;rootme&amp;lt;/code&amp;gt; and &lt;code&amp;gt;qtonpi&amp;lt;/code&amp;gt; respectively.


Upon booting and logging into your Raspberry Pi device as <code>root</code>, you’ll need to enable networking (which is disabled by default!). If you’ve <span class="caps">DHCP</span> setup, find out the ethernet interface of your Raspberry Pi device by doing <code>ifconfig -a</code> and run <code>dhclient eth0</code> on that interface.
Upon booting and logging into your Raspberry Pi device as &lt;code&amp;gt;root&amp;lt;/code&amp;gt;, you'll need to enable networking (which is disabled by default!). If you've DHCP setup, find out the ethernet interface of your Raspberry Pi device by doing &lt;code&amp;gt;ifconfig -a&amp;lt;/code&amp;gt; and run &lt;code&amp;gt;dhclient eth0&amp;lt;/code&amp;gt; on that interface.


<code>dhclient</code> usually does a lousy job at giving useful information. So, once you are back on the command prompt, do an <code>ifconfig -a</code> to see if an IP Address got assigned. In the above example, eth0 has an IP address of 10.48.194.196.
<code><br />-bash-4.1# ifconfig -a<br />eth0 Link encap:Ethernet HWaddr B8:27:EB:E2:26:B5


Then update the date/time on Raspberry Pi device. This can be done easily using <code>ntpdate</code>
[…]


===Configuring Qt Creator, Toolchain, Qt 5 and Raspberry Pi board===
-bash-4.1# dhclient eth0


====Connecting Qt Creator to Raspberry Pi board====
[…]
 
-bash-4.1# ifconfig -a<br />eth0 Link encap:Ethernet HWaddr B8:27:EB:44:23:50<br /> inet addr:10.48.194.196 Bcast:10.48.194.255 Mask:255.255.255.128<br /> UP BROADCAST RUNNING MULTICAST MTU:1488 Metric:1<br /> RX packets:549 errors:0 dropped:0 overruns:0 frame:0<br /> TX packets:46 errors:0 dropped:0 overruns:0 carrier:0<br /> collisions:0 txqueuelen:1000<br /> RX bytes:90538 (88.4 KiB) TX bytes:8025 (7.8 KiB)<br /></code>
 
&lt;code&amp;gt;dhclient&amp;lt;/code&amp;gt; usually does a lousy job at giving useful information. So, once you are back on the command prompt, do an &lt;code&amp;gt;ifconfig -a&amp;lt;/code&amp;gt; to see if an IP Address got assigned. In the above example, eth0 has an IP address of 10.48.194.196.
 
Then update the date/time on Raspberry Pi device. This can be done easily using &lt;code&amp;gt;ntpdate&amp;lt;/code&amp;gt;
 
<code><br />-bash-4.1# ntpdate -u 0.us.pool.ntp.org<br /></code>
 
=== Configuring Qt Creator, Toolchain, Qt 5 and Raspberry Pi board ===
 
==== Connecting Qt Creator to Raspberry Pi board ====


By this time you should be able to ssh from your host machine (running Qt Creator) into your Raspberry Pi Board. If you are not able to do so, please check your network connectivity before proceeding any further!
By this time you should be able to ssh from your host machine (running Qt Creator) into your Raspberry Pi Board. If you are not able to do so, please check your network connectivity before proceeding any further!


# Launch Qt Creator and select '''Tools -&gt; Options -&gt; Linux Devices'''
# Launch Qt Creator and select '''Tools <s>&gt; Options</s>&gt; Linux Devices'''
# Click '''Add''' and select '''Generic Linux Device'''. Then Click on '''Start Wizard'''
# Click '''Add''' and select '''Generic Linux Device'''. Then Click on '''Start Wizard'''
# Enter the following in the dialog box that appears
# Enter the following in the dialog box that appears
#* The name to identify this configuration: <code>Raspberry Pi</code>
#* The name to identify this configuration: &lt;code&amp;gt;Raspberry Pi&amp;lt;/code&amp;gt;
#* The device’s hostname or IP address : ‘‘IP Address of your Raspberry Pi device’‘
#* The device's hostname or IP address : ''IP Address of your Raspberry Pi device''
#* The user name to log into the device: <code>root</code>
#* The user name to log into the device: &lt;code&amp;gt;root&amp;lt;/code&amp;gt;
#* The authentication type: ‘‘Select Password’‘
#* The authentication type: ''Select Password''
#* The user’s password: <code>rootme</code>
#* The user's password: &lt;code&amp;gt;rootme&amp;lt;/code&amp;gt;
# Click '''Next''' followed by '''Finish'''
# Click '''Next''' followed by '''Finish'''
# The Device Test should finish successfully. If not, go back and check your network connectivity and other settings.
# The Device Test should finish successfully. If not, go back and check your network connectivity and other settings.


====Setting up your toolchain====
==== Setting up your toolchain ====


# In Qt Creator, select '''Tools -&gt; Options -&gt; Build &amp; Run''' and '''Tool Chains''' tab
# In Qt Creator, select '''Tools <s>&gt; Options</s>&gt; Build &amp; Run''' and '''Tool Chains''' tab
# Select '''Manual''' and click on '''Add'''
# Select '''Manual''' and click on '''Add'''
# In the dropdown menu, select '''<span class="caps">GCC</span>'''
# In the dropdown menu, select '''GCC'''
# Then select '''<span class="caps">GCC</span>''', as it appears below '''Manual''' and specify the ‘‘Compiler path:’‘ as ‘’/opt/qtonpi/bin/armv5tel-qtonpi-linux-gnueabi-gcc’‘ and ‘‘Debugger:’‘ as ‘’/opt/qtonpi/bin/armv5tel-qtonpi-linux-gnueabi-gdb’‘
# Then select '''GCC''', as it appears below '''Manual''' and specify the ''Compiler path:'' as ''/opt/qtonpi/bin/armv5tel-qtonpi-linux-gnueabi-gcc'' and ''Debugger:'' as ''/opt/qtonpi/bin/armv5tel-qtonpi-linux-gnueabi-gdb''
# Click on '''Apply''' and select '''OK'''
# Click on '''Apply''' and select '''OK'''


====Selecting Qt 5 for Raspberry Pi====
==== Selecting Qt 5 for Raspberry Pi ====


# In Qt Creator, select '''Tools -&gt; Options -&gt; Build &amp; Run''' and '''Qt Versions''' tab
# In Qt Creator, select '''Tools <s>&gt; Options</s>&gt; Build &amp; Run''' and '''Qt Versions''' tab
# Select '''Manual''' and click on '''Add…'''
# Select '''Manual''' and click on '''Add…'''
# Then select <code>qmake</code> file located in ‘’/opt/qt5/bin/qmake’‘ and click on '''Open'''
# Then select &lt;code&amp;gt;qmake&amp;lt;/code&amp;gt; file located in ''/opt/qt5/bin/qmake'' and click on '''Open'''
# Click on '''Apply''' and select '''OK'''
# Click on '''Apply''' and select '''OK'''


Qt creator might indicate “Qt version 5.0.0 for Desktop”, which can be safely ignored for now.
Qt creator might indicate &quot;Qt version 5.0.0 for Desktop&amp;quot;, which can be safely ignored for now.


==Hello QtonPi!==
== Hello QtonPi! ==


QtonPi App <span class="caps">SDK</span> comes with <code>hello-qtonpi</code> App to get you started with Qt 5, which is located here,
QtonPi App SDK comes with &lt;code&amp;gt;hello-qtonpi&amp;lt;/code&amp;gt; App to get you started with Qt 5, which is located here,
 
<code><br />qtonpi-X.Y/<br />├── app-sdk/<br />│ ├── hello-qtonpi.tar.bz2<br /></code>


Feel free to extract the tarball anywhere in your home directory.
Feel free to extract the tarball anywhere in your home directory.


Next launch Qt Creator (if you don’t already have it running!), and do the following.
<code><br />$ pwd<br />/home/rajiv<br />$ tar jxvf qtonpi-0.2/app-sdk/hello-qtonpi.tar.bz2<br />hello-qtonpi/<br />hello-qtonpi/main.cpp<br />hello-qtonpi/hello-qtonpi.pro<br />[…]<br /></code>


# Select '''File -&gt; Open File or Project…''', navigate to <code>hello-qtonpi/hello-qtonpi.pro</code> and click '''Open'''
Next launch Qt Creator (if you don't already have it running!), and do the following.
 
# Select '''File -&gt; Open File or Project…''', navigate to &lt;code&amp;gt;hello-qtonpi/hello-qtonpi.pro&amp;lt;/code&amp;gt; and click '''Open'''
# When you do this first time, '''Project Setup''' Dialog appears for the Target Setup, with sane defaults. Select '''Finish'''
# When you do this first time, '''Project Setup''' Dialog appears for the Target Setup, with sane defaults. Select '''Finish'''
# In the side-bar, select '''Projects''' mode or press Control-5, and go into '''Run Settings'''
# In the side-bar, select '''Projects''' mode or press Control-5, and go into '''Run Settings'''
# In the '''Deployment''' section, click on '''Add''' and select '''Deploy to Remote Linux Host'''
# In the '''Deployment''' section, click on '''Add''' and select '''Deploy to Remote Linux Host'''
# In '''Device Configuration''' you should see ‘‘Raspberry Pi (Default)’‘
# In '''Device Configuration''' you should see ''Raspberry Pi (Default)''
# In the '''Run''' section, click on '''Add''' and select '''hello-qtonpi (on Remote Generic Linux Host)'''
# In the '''Run''' section, click on '''Add''' and select '''hello-qtonpi (on Remote Generic Linux Host)'''
# At this point, you should be all set to roll. In the side-bar, select '''Edit''' mode or press Control-2
# At this point, you should be all set to roll. In the side-bar, select '''Edit''' mode or press Control-2
# To build your project, select '''Build -&gt; Build All'''. This should build the binary using QtonPi toolchain.
# To build your project, select '''Build -&gt; Build All'''. This should build the binary using QtonPi toolchain.
# Next step would be deploy your binaries onto your Raspberry Pi Device. To do this, select '''Build -&gt; Deploy All'''. Your Raspberry Pi device should now have <code>hello-qtonpi</code> executable in <code>/root/hello-qtonpi</code> directory.
# Next step would be deploy your binaries onto your Raspberry Pi Device. To do this, select '''Build -&gt; Deploy All'''. Your Raspberry Pi device should now have &lt;code&amp;gt;hello-qtonpi&amp;lt;/code&amp;gt; executable in &lt;code&amp;gt;/root/hello-qtonpi&amp;lt;/code&amp;gt; directory.
# To run your newly minted App, select '''Build -&gt; Run''', and at this point you should see your Qt 5 Qt Quick App running on your display
# To run your newly minted App, select '''Build <s>&gt; Run*, and at this point you should see your Qt 5 Qt Quick App running on your display
<br />Now that you've a working QtonPi SDK, next step would be to learn more about Qt Quick. Following are some resources to help you get started.
<br />* &quot;Qt Essentials</s> Qt Quick for C++ Developers&amp;quot;:http://qt.nokia.com/learning/online/training/materials/qt-essentials-qt-quick-edition<br />''' &quot;Qt Quick for Designers&amp;quot;:http://qt.nokia.com/learning/online/training/materials/qt-quick-for-designers


Now that you’ve a working QtonPi <span class="caps">SDK</span>, next step would be to learn more about Qt Quick. Following are some resources to help you get started.
== Uninstall ==


* [http://qt.nokia.com/learning/online/training/materials/qt-essentials-qt-quick-edition Qt Essentials – Qt Quick for C++ Developers] ''[qt.nokia.com]''
Release 0.x of QtonPi SDK consists of three parts, which you'll need to uninstall separately.
* [http://qt.nokia.com/learning/online/training/materials/qt-quick-for-designers Qt Quick for Designers] ''[qt.nokia.com]''
 
==Uninstall==
 
Release 0.x of QtonPi <span class="caps">SDK</span> consists of three parts, which you’ll need to uninstall separately.


# Qt Creator
# Qt Creator
Line 134: Line 166:
# QtonPi Toolchain and Sysroot
# QtonPi Toolchain and Sysroot


'''Note – * If you are updating between 0.x releases, you *do not''' have to uninstall Qt Creator each time.
'''Note -''' If you are updating between 0.x releases, you '''do not''' have to uninstall Qt Creator each time.


===Qt Creator===
=== Qt Creator ===


In order to uninstall Qt Creator, go to the <code>bin/</code> directory in your Qt Creator installation and execute the <code>uninstall</code> command.
In order to uninstall Qt Creator, go to the &lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; directory in your Qt Creator installation and execute the &lt;code&amp;gt;uninstall&amp;lt;/code&amp;gt; command.


===Toolchain and Sysroot===
<code><br />$ pwd<br />/home/rajiv<br />$ cd qtcreator-2.4.1/bin<br />$ pwd<br />/home/rajiv/qtcreator-2.4.1/bin<br />$ ./uninstall<br /></code>


Uninstalling the toolchain and sysroot is as simple as removing the <code>/opt/qtonpi/</code> directory.
=== Toolchain and Sysroot ===
 
Uninstalling the toolchain and sysroot is as simple as removing the &lt;code&amp;gt;/opt/qtonpi/&amp;lt;/code&amp;gt; directory.
 
<code><br />$ sudo rm -rf /opt/qtonpi/<br /></code>


Should take care of it!
Should take care of it!


===Qt 5===
=== Qt 5 ===
 
Likewise, to uninstall Qt 5, remove <code>/opt/qt5/</code> directory.


===Categories:===
Likewise, to uninstall Qt 5, remove &lt;code&amp;gt;/opt/qt5/&amp;lt;/code&amp;gt; directory.


* [[:Category:QtonPi|QtonPi]]
<code><br />$ sudo rm -rf /opt/qt5/

Revision as of 14:40, 23 February 2015


[toc align_right="yes&quot; depth="2&quot;]

Qt on Raspberry Pi — Create

QtonPi App SDK

QtonPi Release-0.x App SDK consists of,

  • Qt Creator
  • Sysroot + Toolchain

As indicated in the roadmap, we hope to have a more integrated App SDK from Release-1.x onwards.

Download

QtonPi releases are distributed via BitTorrent. QtonPi download page is here.

Upon downloading a QtonPi release, you should see a tarball <code&gt;qtonpi-X.Y.tar.bz2&lt;/code&gt;, where <code&gt;"X&quot;</code&gt; is the major release number and <code&gt;"Y&quot;</code&gt; is the minor release.

QtonPi release directory is organized as follows,

<br />qtonpi-X.Y/<br />├── app-sdk/<br />├── platform-sdk/<br /> ├── host-rpms/<br /> ├── image-creator-binaries/<br /> └── mt-cross-tools/<br />└── sdcard-img/<br />

Following is a brief description of the directory structure,

<code&gt;app-sdk/&lt;/code&gt; Application SDK
<code&gt;platform-sdk/&lt;/code&gt; Platform SDK - In case you would like to roll your own SD Card Image and/or Sysroot. See [[Contribute
<code&gt;sdcard-img/&lt;/code&gt; Default SD Card Image - Please use this for reporting bugs!

Install

Qt Creator

First step would be to install Qt Creator. You will find Qt Creator installer here,

<br />qtonpi-X.Y/<br />├── app-sdk/<br /> └── qt-creator-linux-x86-opensource-2.x.y.bin<br />

To install, just run the <code&gt;qt-creator-linux-x86-opensource-2.x.y.bin&lt;/code&gt; file

<br />$ pwd<br />/home/rajiv/qtonpi-0.2/app-sdk<br />$ ./qt-creator-linux-x86-opensource-2.4.1.bin<br />

This should install, launch Qt Creator. In addition, it'll also create an icon on your Desktop.

Toolchain and Sysroot

Next step would be to install the toolchain and default sysroot. You can find it here,

<br />qtonpi-X.Y/<br />├── app-sdk/<br /> └── toolchain-and-sysroot-armv5tel.tar.bz2<br />

You will need to extract this as <code&gt;root&lt;/code&gt; user, into the <code&gt;root("/&quot;)</code&gt; directory of your filesystem.

<br />$ cd /<br />$ pwd<br />/<br />$ sudo tar jxvf /home/rajiv/qtonpi-0.2/app-sdk/toolchain-and-sysroot-armv5tel.tar.bz2<br />

Qt 5

QtonPi ships with a known working (necessarily not stable!) version of Qt 5. This version works both on the sysroot and the target and you can find it here,

<br />qtonpi-0.2/<br />├── app-sdk/<br /> ├── opt-qt5-current.tar.bz2<br />

You will need to extract this as <code&gt;root&lt;/code&gt; user, into the <code&gt;root("/&quot;)</code&gt; directory of your filesystem.

<br />$ cd /<br />$ pwd<br />/<br />$ sudo tar jxvf /home/rajiv/qtonpi-0.2/app-sdk/opt-qt5-current.tar.bz2<br />

SD Card Image

In addition, there is also a default 2GB SD Card Image, with Qt 5 on it. You'll find it here.

<br />qtonpi-X.Y/<br />└── sdcard-img/<br /> └── qtonpi-sdcard-X.Y.img.bz2<br />

To setup your SD card, <code&gt;cat/dd&lt;/code&gt; the contents of this file onto your SD Card. Assuming your SD Card device is <code&gt;/dev/sdb&lt;/code&gt;, one way to do this is as follows. Note you'll need to be logged in as <code&gt;root&lt;/code&gt; in order to be able to write to <code&gt;/dev/sdb&lt;/code&gt; device.

<br /># pwd<br />/home/rajiv/qtonpi-0.2/sdcard-img<br /># bzcat qtonpi-sdcard-0.2.img.bz2 &gt; /dev/sdb; sync<br />

You're now ready to boot your Raspberry Pi Device! There are two accounts - <code&gt;root&lt;/code&gt; and <code&gt;qtonpi&lt;/code&gt;. Password for the accounts are <code&gt;rootme&lt;/code&gt; and <code&gt;qtonpi&lt;/code&gt; respectively.

Upon booting and logging into your Raspberry Pi device as <code&gt;root&lt;/code&gt;, you'll need to enable networking (which is disabled by default!). If you've DHCP setup, find out the ethernet interface of your Raspberry Pi device by doing <code&gt;ifconfig -a&lt;/code&gt; and run <code&gt;dhclient eth0&lt;/code&gt; on that interface.

<br />-bash-4.1# ifconfig -a<br />eth0 Link encap:Ethernet HWaddr B8:27:EB:E2:26:B5

[]

-bash-4.1# dhclient eth0

[]

-bash-4.1# ifconfig -a<br />eth0 Link encap:Ethernet HWaddr B8:27:EB:44:23:50<br /> inet addr:10.48.194.196 Bcast:10.48.194.255 Mask:255.255.255.128<br /> UP BROADCAST RUNNING MULTICAST MTU:1488 Metric:1<br /> RX packets:549 errors:0 dropped:0 overruns:0 frame:0<br /> TX packets:46 errors:0 dropped:0 overruns:0 carrier:0<br /> collisions:0 txqueuelen:1000<br /> RX bytes:90538 (88.4 KiB) TX bytes:8025 (7.8 KiB)<br />

<code&gt;dhclient&lt;/code&gt; usually does a lousy job at giving useful information. So, once you are back on the command prompt, do an <code&gt;ifconfig -a&lt;/code&gt; to see if an IP Address got assigned. In the above example, eth0 has an IP address of 10.48.194.196.

Then update the date/time on Raspberry Pi device. This can be done easily using <code&gt;ntpdate&lt;/code&gt;

<br />-bash-4.1# ntpdate -u 0.us.pool.ntp.org<br />

Configuring Qt Creator, Toolchain, Qt 5 and Raspberry Pi board

Connecting Qt Creator to Raspberry Pi board

By this time you should be able to ssh from your host machine (running Qt Creator) into your Raspberry Pi Board. If you are not able to do so, please check your network connectivity before proceeding any further!

  1. Launch Qt Creator and select Tools > Options> Linux Devices
  2. Click Add and select Generic Linux Device. Then Click on Start Wizard
  3. Enter the following in the dialog box that appears
    • The name to identify this configuration: <code&gt;Raspberry Pi&lt;/code&gt;
    • The device's hostname or IP address : IP Address of your Raspberry Pi device
    • The user name to log into the device: <code&gt;root&lt;/code&gt;
    • The authentication type: Select Password
    • The user's password: <code&gt;rootme&lt;/code&gt;
  4. Click Next followed by Finish
  5. The Device Test should finish successfully. If not, go back and check your network connectivity and other settings.

Setting up your toolchain

  1. In Qt Creator, select Tools > Options> Build & Run and Tool Chains tab
  2. Select Manual and click on Add
  3. In the dropdown menu, select GCC
  4. Then select GCC, as it appears below Manual and specify the Compiler path: as /opt/qtonpi/bin/armv5tel-qtonpi-linux-gnueabi-gcc and Debugger: as /opt/qtonpi/bin/armv5tel-qtonpi-linux-gnueabi-gdb
  5. Click on Apply and select OK

Selecting Qt 5 for Raspberry Pi

  1. In Qt Creator, select Tools > Options> Build & Run and Qt Versions tab
  2. Select Manual and click on Add…
  3. Then select <code&gt;qmake&lt;/code&gt; file located in /opt/qt5/bin/qmake and click on Open
  4. Click on Apply and select OK

Qt creator might indicate "Qt version 5.0.0 for Desktop&quot;, which can be safely ignored for now.

Hello QtonPi!

QtonPi App SDK comes with <code&gt;hello-qtonpi&lt;/code&gt; App to get you started with Qt 5, which is located here,

<br />qtonpi-X.Y/<br />├── app-sdk/<br /> ├── hello-qtonpi.tar.bz2<br />

Feel free to extract the tarball anywhere in your home directory.

<br />$ pwd<br />/home/rajiv<br />$ tar jxvf qtonpi-0.2/app-sdk/hello-qtonpi.tar.bz2<br />hello-qtonpi/<br />hello-qtonpi/main.cpp<br />hello-qtonpi/hello-qtonpi.pro<br />[]<br />

Next launch Qt Creator (if you don't already have it running!), and do the following.

  1. Select File -> Open File or Project…, navigate to <code&gt;hello-qtonpi/hello-qtonpi.pro&lt;/code&gt; and click Open
  2. When you do this first time, Project Setup Dialog appears for the Target Setup, with sane defaults. Select Finish
  3. In the side-bar, select Projects mode or press Control-5, and go into Run Settings
  4. In the Deployment section, click on Add and select Deploy to Remote Linux Host
  5. In Device Configuration you should see Raspberry Pi (Default)
  6. In the Run section, click on Add and select hello-qtonpi (on Remote Generic Linux Host)
  7. At this point, you should be all set to roll. In the side-bar, select Edit mode or press Control-2
  8. To build your project, select Build -> Build All. This should build the binary using QtonPi toolchain.
  9. Next step would be deploy your binaries onto your Raspberry Pi Device. To do this, select Build -> Deploy All. Your Raspberry Pi device should now have <code&gt;hello-qtonpi&lt;/code&gt; executable in <code&gt;/root/hello-qtonpi&lt;/code&gt; directory.
  10. To run your newly minted App, select Build > Run*, and at this point you should see your Qt 5 Qt Quick App running on your display


Now that you've a working QtonPi SDK, next step would be to learn more about Qt Quick. Following are some resources to help you get started.
* "Qt Essentials
Qt Quick for C++ Developers&quot;:http://qt.nokia.com/learning/online/training/materials/qt-essentials-qt-quick-edition
"Qt Quick for Designers&quot;:http://qt.nokia.com/learning/online/training/materials/qt-quick-for-designers

Uninstall

Release 0.x of QtonPi SDK consists of three parts, which you'll need to uninstall separately.

  1. Qt Creator
  2. Qt 5
  3. QtonPi Toolchain and Sysroot

Note - If you are updating between 0.x releases, you do not have to uninstall Qt Creator each time.

Qt Creator

In order to uninstall Qt Creator, go to the <code&gt;bin/&lt;/code&gt; directory in your Qt Creator installation and execute the <code&gt;uninstall&lt;/code&gt; command.

<br />$ pwd<br />/home/rajiv<br />$ cd qtcreator-2.4.1/bin<br />$ pwd<br />/home/rajiv/qtcreator-2.4.1/bin<br />$ ./uninstall<br />

Toolchain and Sysroot

Uninstalling the toolchain and sysroot is as simple as removing the <code&gt;/opt/qtonpi/&lt;/code&gt; directory.

<br />$ sudo rm -rf /opt/qtonpi/<br />

Should take care of it!

Qt 5

Likewise, to uninstall Qt 5, remove <code&gt;/opt/qt5/&lt;/code&gt; directory.


$ sudo rm -rf /opt/qt5/