In this project the Raspberrypi board is loaded with Ubuntu and is remotely accessed using VNC. The Raspberrypi board is also connected to the internet. Installing the QT in Raspberry pi is actually very easy using the commands, but it will take 30 minutes to 4 hours to finish the installation depending upon the speed of the internet connection. Downloading and installing the fourth version, QT4 is discussed in the following:
Open the command terminal and type the following command:
apt-get install qt4-dev-tools
If not logged as the root user, add the sudo before the command like:
sudo apt-get install qt4-dev-tools
Once the Ubuntu finds the files to be downloaded it will ask permission to proceed. Around 350 Mb is required to download all these files and hence make sure that the SDcard has enough free space available.
Type ‘y’ and press Enter to proceed.
That will install all the required development tools for the QT IDE and the next step is to install the QT IDE itself.
Use the following commands:
apt-get install qtcreator
sudo apt-get install qtcreator
Again another 350 Mb is required to download all the files and type ‘y’ and press Enter to proceed with the downloading and installation.
Wait till it finishes, and once the installation is complete the user can find them listed under the installed programs for ‘Programming’ as shown in the following image:
Fig. 2: QT Listed In Installed Programs For ‘Programming’
The list includes “Qt 4 Assistant”, “Qt 4 Designer”, “Qt 4 Linguist” and “Qt Creator”. The “Qt 4 Assistant” is basically provides help in the form of documentations related to the topics in QT. “Qt 4 Designer” is where the user can create a design and save it as a ‘.ui’ file which can then be used in QT projects. The “Qt 4 Linguist” provides a language view of the design created. The “Qt Creator” is where all these things can be done in the same IDE which helps in creating a GUI using QT.
Click on the “Qt Creator” and the following window opens up which includes options for creating a project, editing the code, design the UI and even option for debugging. Options are available in the same window for compile, build and run also.
Fig. 3: Qt Creator Window In Raspberry Pi
First time users are suggested to go through the “Examples” and “Tutorials” to get a quick overview about using the QT.
There are a few settings to be done before getting started with the application development using QT. The path of the compiler tool chains need to be set in the IDE. Go to “Tools” >> “Options”.
Fig. 4: Changing Path Of Compiler Tool From Options
Select the option “Build & Run” go to its “General” settings and check the things as shown in the following image:
Fig. 5: Selecting General Setting For “Build & Run” To Use QT In Raspberry Pi Board
Go to the “Qt Versions” and make sure that the path is the same as shown in the following image:
Fig. 6: Checking The Path In QT Version Tab
To set the tool chain path, open the “Tool Chain” tab and click on the “Add” button.
Fig. 7: Set Tool Chain Path In QT Window
Select the “GCC” from the drop down list as shown in the image. Now click on the “GCC” and browse to the “/usr/bin” and select the arm-linux-gnueabi-g++-4.6
Fig. 8: Select GCC” And arm-linux-gnueabi-g++-4.6 To Create Applications In Raspberry Pi Board
Click “Apply” and then “Ok” and the QT is ready in to create applications in the Raspberrypi board.