The Qt platform is an independent application that runs on all the desktops and the operating systems.
The Os es will include Linux, windows embedded, and VxWorks.
The application will run across multiple platforms and qt will save a lot of time.
It has extensive API and well-documented features as highly integrated tools.
The application will run across platforms at near-native places.
The applications of Qt are,
$ sudo apt-get install GCC
To install Qt creator we install the commands like,
$sudo apt-get update
sudo apt-get upgrade
sudo apt-get install qt-dev-tools
sudo apt-get install qtcreator
sudo apt-get git-core
sudo apt-get install subversion
After all steps, the Qt Creator will be added to the programming list on Raspberry Pi.
Then for Setting up Qt platform on Raspbian OS,
We have to run the Qt Creator for the first time,
Fig. 1: Compilers window
Fig. 2: Adding the path
Fig. 3: Select latest version of Qt
4. Select device type
We start by clicking on New Project.
Select Applications>Qt Widgets Application>Choose as shown in Fig. 5.
The type in the name of your project and choose the destination folder where you want to save your project as shown in Fig. 6.
Select the kit as Raspberry Pi and then click on Next as in Fig. 7.
We continue with default names in the class information sub-window.
Click on Next.
Click on Finish.
The new project called Hello World will be creating and Project Explorer will show all project files.
Click on Build>Build Project. The console window will show no errors if the kit is configured correctly.
Click on Build>Run. MainWindow will displays as shown in fig 10.
When you click on main.cpp, the default screen will appear.
Add the following code to main.cpp to display ‘Hello World’ on the main window form as shown in Fig. 11.
Fig. 5: Select Qt widgets application
Fig. 6: Project name
Fig. 7: Select Raspberry Pi kit
Fig. 8: Class information window
Fig. 9: HelloWorld project on Project Explorer window
Fig. 10: Main Window screen
Qlabel*label=new Qlabel (&w);
lable->setText=newQlabel (&w);
lable->setText= (“Hello world”);
lable->setAlignment (Qt::Aligncenter);
11. Click on Build>Run. The form with ‘Hello World’.