Thanks Bargi !
The command which i used to run my application is: - first i went to directory where my project file is i.e. Convert & then i used "qmake -o Makefile metric.pro". Then i used "make" command to get its executable. Finally i used "metric" to run the application.
Below is the output screen of the terminal: -
abcdxyz:~

1)> cd Convert
abcdxyz:~/Convert

2)> qmake -o Makefile metric.pro
abcdxyz:~/Convert

3)> make
g++ -o metric .obj/main.o .obj/conversionform.o .obj/qmake_image_collection.o .obj/moc_conversionform.o -L/usr/lib64/qt-3.1/lib -L/usr/X11R6/lib64 -lqt-mt -lXext -lX11 -lm
abcdxyz:~/Convert

4)> metric
metric: Command not found.
abcdxyz:~/Convert

5)> ./metric
metric: cannot connect to X server
:-----------:---------Conversionform.ui.h------------:-----------:
void ConversionForm::convert()
{
enum MetricUnits {
Kilometers,
Meters,
Centimeters,
Millimeters
};
enum OldUnits {
Miles,
Yards,
Feet,
Inches
};
// Retrieve the input
double input = numberLineEdit->text().toDouble();
double scaledInput = input;
// internally convert the input to millimeters
switch ( fromComboBox->currentItem() ) {
case Kilometers:
scaledInput *= 1000000;
break;
case Meters:
scaledInput *= 1000;
break;
case Centimeters:
scaledInput *= 10;
break;
}
//convert to inches
double result = scaledInput * 0.0393701;
switch ( toComboBox->currentItem() ) {
case Miles:
result /= 63360;
break;
case Yards:
result /= 36;
break;
case Feet:
result /= 12;
break;
}
// set the result
int decimals = decimalsSpinBox->value();
resultLineEdit->setText( QString::number( result, 'f', decimals ) );
numberLineEdit->setText( QString::number( input, 'f', decimals ) );
}
#include <qvalidator.h>
void ConversionForm::init()
{
numberLineEdit->setValidator( new QDoubleValidator( numberLineEdit ) );
numberLineEdit->setText( "10" );
convert();
numberLineEdit->selectAll();
:--------------:---------End of file--------------:--------------:
:--------------:--------main.cpp-----------:--------------:
#include <qapplication.h>
#include "conversionform.h"
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
ConversionForm w;
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
:-------------:--------End of file---------:--------------:
Thanks in advance for helping me out.