Changes

Jump to: navigation, search

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

544 bytes added, 14:16, 26 August 2022
Qt application example
<pre>
dvdk@vagrant-ubuntu-trusty-64:~$ ./qtcreator-4.54.21/bin/qtcreator
</pre>
Now click on <code>New Project</code>
[[File:QtCreator XELK 3 0 0 11-4.4.1_project.png|400px1200px|border|center]]
Select Application Qt Widgets Application and click '''Choose...'''
[[File:QtCreator XELK 3 0 0 12-4.4.1_new-project.png|400px800px|border|center]]
Now call the Project ''Test'' and press '''Next'''.
[[File:QtCreator XELK 3 0 0 13-4.4.1_new-project-test.png|400px|border|center]]
Select the ''XELK KitSBC AXEL EVK'' and click '''Next'''.
[[File:QtCreator XELK 3 0 0 14-4.4.1_new-project-SBC-AXEL-EVK.png|400px800px|border|center]]
Choose the ''class'' name for your application.
[[File:QtCreator XELK 3 0 0 15-4.4.1_new-project-SBC-AXEL-EVK-class.png|400px800px|border|center]]
Click '''Finish''' to conclude the setup.
[[File:QtCreator XELK 3 0 0 16-4.4.1_new-project-SBC-AXEL-EVK-finish.png|400px800px|border|center]]
To add a clickable button to your application, select the <code>Edit</code> window and select <code>Test -> Forms -> mainwindow.ui</code>
[[File:QtCreator XELK 3 0 0 17-4.4.1_project-Test-MainWindow.png|400px1200px|border|center]]
Click on Push Button in the Buttons tab and drag it to the main window view. In order to edit the text displayed by the label, double click it and write ''"Hello World!"''.
[[File:QtCreator XELK 3 0 0 18-4.4.1_project-Test-MainWindow-Pushbutton.png|400px1200px|border|center]]
After that, you need to insert the following two line inside the ''Test.pro'' file
<pre>
target.path = /tmphome/root/Test # path on device
</pre>
<pre>
</pre>
Where <code>/temphome/root/Test</code> is the path in which your application will be downloaded inside the device.
[[File:QtCreator XELK 3 0 0 19-4.4.1_project-Test-MainWindow-TestPro.png|1200px|border|center]] Build the project in order to complete the configuration and set the overall vars: [[File:QtCreator-4.4.1_project-Test-MainWindow-Build.png|400px1200px|border|center]]
The last step before running the application inside the device is to configure Qt backend into application command line arguments: open the <code>Project</code> window and select the <code>Run</code> configuration, then type <code>-platform eglfs</code> into <code>Arguments</code>
[[File:QtCreator XELK 3 0 0 20-4.4.1_project-Test-MainWindow-eglfs.png|400px1200px|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 35.png|30px]]
[[File:QtCreator XELK 3 0 0 21-4.4.1_project-Test-MainWindow-debug.png|1200px|border|center]] The debugger (via <code>gdb server</code>) will be activated and the debug window will be ready: [[File:QtCreator-4.4.1_project-Test-MainWindow-debug-running.png|400px1200px|border|center]]
8,221
edits

Navigation menu