Difference between revisions of "IoTGateway/BSP/Linux/AM335x/Qt Application Development"

From ESS-WIKI
Jump to: navigation, search
(Setup Environment in gui mode)
(Setup Environment in gui mode)
Line 25: Line 25:
  
 
Then, there are some steps to setup your developement environment as follow:
 
Then, there are some steps to setup your developement environment as follow:
 +
== <span style="color:#0070c0;"> Start the qtcreator IDE </span> ==
 +
<pre>
 +
$ cd  $(BSP_ROOT)/cross_compiler/linux-devkit>
 +
$ source  environment-setup
 +
$ cd $(your_qtcreator_install_path)/Tools/QtCreator/bin
 +
$ ./qtcreator.sh
 +
</pre>
 +
And the QtCreator's main window shows up.
 +
[[Image: Qt1.png]]<br>
 +
Check QtCreator's version by using "Help" -> "About Qt Creator".
 +
[[Image: Qt2.png ]] <br>

Revision as of 09:30, 28 September 2016

We have two ways to build a Qt project: the command line mode and the gui mode. We have a description as follow:

Setup Environment in command line mode

If you want to build C, C++, Qt and other linux application, there is a magical script to use. It’s environment-setup in the $(BSP_ROOT)/cross_compiler/linux-devkit directory. To build some linux application, you just need to excute this script as follow, and then everything will be ok.

$ cd  $(BSP_ROOT)/cross_compiler/linux-devkit> 
$ source  environment-setup

After this, you can buid Qt project. For example, we have a calculator qt demo to build as follow:

$  cd  $(demo)/calculator
$  ls 
button.cpp  button.h  calculator.cpp  calculator.h  calculator.pro  main.cpp
$  qmake calculator.pro   ## Generating a makefile
$  make  	## If no error, a binary will be generated after make.

Setup Environment in gui mode

Qt Creator is a cross-platform IDE that makes application and UI development a breeze. Since time-to-market is key, the IDE includes productivity tools that speed up your development time. Before your qt developement in gui mode, a qtcreator is essential. You can download it at this link https://www.qt.io/download/. The Installation package qt-unified-linux-x64-2.0.3-1-online.run is recommended, because we have tested it on ubuntu14.04 and some previous version of qtcreator installer has some bugs on using gdb debugging.

Then, there are some steps to setup your developement environment as follow:

Start the qtcreator IDE

$ cd  $(BSP_ROOT)/cross_compiler/linux-devkit> 
$ source  environment-setup
$ cd $(your_qtcreator_install_path)/Tools/QtCreator/bin
$ ./qtcreator.sh

And the QtCreator's main window shows up. Qt1.png
Check QtCreator's version by using "Help" -> "About Qt Creator". Qt2.png