Embedded Linux – Working with QT

Qt is a great framework for building cross-platform applications. It provides a set of classes to wrap almost any OS service and you can write your application once and compile and deploy it many.

Qt is also a great choice for embedded Linux system. If you need GUI, Qt is the fastest way. Write your code and test it on your desktop computer and then compile and deploy it to the target system.

In this tutorial, we will use the system we build using QEMU to configure, compile and test QT 5 applications.

Build QT using Buildroot

It is very easy to configure QT for embedded Linux system using buildroot. Open the configuration menu:

Go to Target packages > Graphic libraries and applications (graphic/text) and select Qt5

in Qt5 menu select the following options:

Save and run make, then copy the output to ~/armsystem/outfs

Now you can check some QT examples in /usr/lib/qt/examples

 

Build your own QT application

Download and install Qt creator from here – select the free version

Run Qt Creator, select new project -> Qt Widgets Application

Name your project

 

Select Desktop QT

Select all defaults and click finish

On the project tree select mainwindow.ui:

Draw push button and lineedit controls

Right-click the push button and select go to slot… -> clicked

Write the button event handler:

Build and run the project on your desktop

 

Build The Application For The Target

Go to the project directory and build for the target using qmake and make:

Now you can run it on the target

 

Tagged

1 thought on “Embedded Linux – Working with QT

  1. Very good tutorials, please continue I’ll be fun of your posts.

Leave a Reply

Your email address will not be published. Required fields are marked *