Changes

Jump to: navigation, search

DESK-MX-L-AN-0007: Getting Started With QT Creator

896 bytes added, 22:52, 1 March 2018
main review
{{InfoBoxTop}}
{{AppliesToAxel}}
{{AppliesToAxelEsatta}}
{{AppliesToAxelLite}}
{{Applies To Yocto}}
{{InfoBoxBottom}}
 
=History=
 
{| class="wikitable" border="1"
!Version
!Date
!XELK version
!Notes
|-
|1.0.0
|March 2018
|[[Axel_Embedded_Linux_Kit_(XELK)#XELK_software_components|3.0.0]]
|First release
|}
 
= Introduction =
 
This application note details QT Creator setup and configuration in [[Axel_Embedded_Linux_Kit_(XELK)|XELK]] [[Managed Virtual Machine (MVM)|MVM]]
 
= Setting up Qt Creator to build for XELK =
 
== Qt Creator Installation ==
 
To install Qt Creator inside your toolchain launch a terminal emulator and run
 
<pre>
dvdk@vagrant-ubuntu-trusty-64:~$ cd axel/
</pre>
 
<pre>
dvdk@vagrant-ubuntu-trusty-64:~/axel$ ./qt-creator-opensource.run
</pre>
 
An installation wizard will appear. Clik '''Next''' to proced with the installation.
[[File:QtCreator XELK 3 0 0 01.png|200px400px|border|center]]
Select '''Skip'''.
[[File:QtCreator XELK 3 0 0 02.png|200px400px|border|center]]
Select '''Next'''.
[[File:QtCreator XELK 3 0 0 03.png|200px400px|border|center]]
Select the install directory or click '''Next'''.
[[File:QtCreator XELK 3 0 0 04.png|200px400px|border|center]]
Select '''Next'''.
[[File:QtCreator XELK 3 0 0 05.png|200px400px|border|center]]
Click '''Next''' again.
[[File:QtCreator XELK 3 0 0 06.png|200px400px|border|center]]
And thenclick then click '''Install''' and complete the installation.
[[File:QtCreator XELK 3 0 0 07.png|200px400px|border|center]]
Then '''Finish''' to exit the setup wizard.
[[File:QtCreator XELK 3 0 0 08.png|200px400px|border|center]]
== Automatic configuration ==
Now it is necessary to add the definition of your board before developing and compiling your applications.
In order to add the device information automatically, DAVE provides a simple setup script. User just need to run the following commands inside your terminal emulator.:
<pre>
dvdk@vagrant-ubuntu-trusty-64:~$ cd axel/
</pre>
<pre>
dvdk@vagrant-ubuntu-trusty-64:~/axel$ ./qt-post-install.sh
</pre>
If the installation process went okcomplete successfully, you should see inside the <code>Tools</code>-><code>Options</code> -> <code>Kits</code> a ''kit '' named XELK., as in the following screenshot:
[[File:QtCreator XELK 3 0 0 09.png|400px|border|center]]
Select the Kits tab and make sure that your configurations mateches matches the one displayed.below:
[[File:QtCreator XELK 3 0 0 10.png|400px|border|center]]
== Manual configuration ==
 
If you don't want to use the automatic setup or want to customize the configuration, in this section we details all the step required.
=== Devices ===
 Go to <code>Tools</code>-><code>Options</code> menu  
[[File:QtCreator XELK 3 0 0 09.png|400px|border|center]]
select Select <code>Devices</code> and click '''Add'''
[[File:QtCreator XELK 3 0 0 22.png|400px|border|center]]
Choose the ''Generic linux Linux device''
[[File:QtCreator XELK 3 0 0 23.png|400px|border|center]]
Insert the IP address of your device, the ''root'' as username and leave password empty (this is the default configuration of the XELK root accountfile systems). Make sure that the device is connected to the network and your virtual machine networking is correctly configured to use a bridge connection(see [[VirtualBox Network Configuration|this]] article for more details).
Click Then click '''Next'''.
[[File:QtCreator XELK 3 0 0 24.png|400px|border|center]]
=== GCC & Cross Compilation ===
Next you need to configure the cross compilation tool inside <code>Build & Run</code> -> <code>Compiler</code>.
[[File:QtCreator XELK 3 0 0 27.png|400px|border|center]]
Click <code>Add</code> -> <code>GCC</code> and add the compiler path.
<pre>
Now that the setup is finished, you can create your first application
 
Open a new terminal and source the environment variables with the command.
<pre>
dvdk@vagrant-ubuntu-trusty-64:~$ ./source env.sh
</pre>
In the same terminal digit type the following command if (we assume you didn't change the default installation directory.)
<pre>
</pre>
<span style{{ImportantMessage|text="color:#ff0000"> It is important to repeat the previous two step each time you close the Qt Creator application. </span>}}
Now click on <code>New Project</code>
Select Application Qt Widgets Application and click '''Choose...'''
 
[[File:QtCreator XELK 3 0 0 12.png|400px|border|center]]
[[File:QtCreator XELK 3 0 0 16.png|400px|border|center]]
To add a clickable button to your application, select the <code>Edit</code> window and select <code>Test</code>-><code>Forms</code>-><code>mainwindow.ui</code>
[[File:QtCreator XELK 3 0 0 17.png|400px|border|center]]
[[File:QtCreator XELK 3 0 0 19.png|400px|border|center]]
The last step before running the application inside the device is to select configure Qt backend into application command line arguments: open the <code>Project </code> window and select the <code>Run </code> configuration and as , then type <code>-platform eglfs</code> into <code>Arguments.</code>
<pre>-platform eglfs</pre>[[File:QtCreator XELK 3 0 0 20.png|400px|border|center]]
After these changes you are ready to debug your application inside your board with the <code>Run/Debug</code> command [[File:QtCreator XELK 3 0 0 2035.png|400px|border|center30px]]
After these changes you are ready to debug your application inside your board with the Run/Debug command [[File:QtCreator XELK 3 0 0 35.png|30px]]
[[File:QtCreator XELK 3 0 0 21.png|400px|border|center]]
743
edits

Navigation menu