Information Computer

Sunday, January 1, 2012

Make Application In Qt Creator (Ubuntu)

First step : Install Qt Cretor
- sudo apt-get install qtcreator (in terminal)
- or install using ubuntu software center

Second step : Make a New Project
- click Create Project
- choose Qt4 GUI Application, then click ok
- fill Name with name of the project that you create
- Create in is location you will save the project
- Then click Next

Third step : Desain Interface
- to design applications, we enter the editor and double-click mainwindow.ui adding components with drag 'n drop components to the form.
- in this tutorial we need :
   ~ 2 spin box
   ~ 2 Labels
   ~ 1 Push Button
- double-click to edit caption
- to change property of object, we look at side panel

Fourth step : Give Code
- to Give code we click-right object, click go to slot then choose event.
- so we click-right Push Button, Click go to slot then choose clicked()
- give code below MainWindow::on_pushbutton_clicked().

qint8 result= ui­>spinbox­>value() + ui­>spinbox_2­>value();
QString resultString=QString::number(result);
ui­>label­>setText(resultString);

Fiveth step : Running application
- save (CTRL + S)
- run (CTRL + R or F5)


need to know! 
Qt Creator is a cross-platform C++ integrated development environment which is part of the Qt SDK. It includes a visual debugger and an integrated GUI layout and forms designer. The editor's features includes syntax highlighting and autocompletion, but not tabs. Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linux and FreeBSD. On Windows it can use MinGW or MSVC with the default install and can also use cdb when compiled from source.

Related Posts



0 comments:

Followers