Sunday 16 February 2014

Creating GUI applications with C++

Are you the person who has struggled enough in console programming (using cout, cin functions) and developing logics. But somewhere you want to develop Graphical user interface to start making your softwares for common people using linux or windows (any). For this you actually need a GUI library to work with. There are plenty of free portable GUI libraries, each with its own strengths and weaknesses:
We have got numerous reasons why we should use qt creator. You can search them on google. So lets get going with Qt creator.
Get Qt-creator
For Windows : 
1. Go to this and download Qt for windows. (There are two versions of it , one for Visual basic developers and other who want to work with minGW compiler.
2. After downloading , install it simply by double-clicking on the file.

For Ubuntu :
1.  Go to this page and download Qt for linux. (you should know whether your installed linux is 32 bit or 64 bit)
2. Open a terminal. In Gnome the terminal is found in Applications>Accessories>Terminal or just press ctrl+alt+t
3. Navigate to the directory of the downloaded .run file . For example, I have mine on the desktop so I would type in "cd ~/Desktop" and press enter.
3. Type "chmod +x example.run" (press enter).
4. Now type "./example.run", press enter, and the installer will run. 5. After installation open the terminal and run the following commands :
sudo apt-get install mesa-common-dev 
sudo apt-get install freeglut3 
sudo apt-get install freeglut3-dev 
sudo apt-get install glut3  
sudo apt-get install glut3-dev 
sudo apt-get install libglut3 
sudo apt-get install libglut3-dev 
sudo apt-get install libglu1-mesa-dev
Congrats! you have installed qt creator for ubuntu. To learn working with qt there are many tutorials available online . You can search for a torrent of Prentice Hall C++ GUI Programming with Qt4 2nd Edition
Tried On : Ubuntu 12.10 , windows 8 and Qt 5.0.1
May also work on : Any other versions of the above and any linux distribution.

No comments:

Post a Comment

Featured Post

PHP EmailMessage class for extracting attachments

Hi, recently I had to create a php program which fetches emails with attachments (including inline). I searched a lot and succeeded with h...