R
Rich Grise
OK, I don't know if this is Off-Topic for the group(s), because "QT" isn't
"Pure C++", and Slackware is a distro, but those guys are sharp.
And I've crossposted to sci.electroncs.design because I can. ;-P
Anyways, I want to crow about what I've done. I've been dabbling, kind of
poking away at the QT tutorials, but when I get to the "Now, write some
C++ to make it all go", I kinda hit a railroad crossing. ;-) So, I
downloaded "Thinking in C++", and actually printed it on dead tree paper,
and took it to bed with me to read myself to sleep. ;-) (it's about 4"
thick, overall, printed single-sided on 20# letter-size. ;-) ) I really
like the way that they mention, "Answers to the exercises are available
for a nominal fee..."
So, anyways, I'm sitting here, kind of bored because there's no work and
it really only takes a couple of hours to catch up on a day's worth
of internet, and something bit me behind the knees, and I hauled out the
ol' QT tutorial again, and popped up TICPPV1.pdf on another window, and
in about an hour I'd produced:
http://www.abiengr.com/~sysop/Share/metric
It doesnt' have any viruses, unless Gnu g++ put them there:
$ file metric
metric: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
(I didn't wrap this, but it's not that important).
But it's different from what came in the QT tutorial:
---------------<quote>---------------------
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 ) );
}
--------------<end quote>--------------------
Which, quite frankly, based on what I've read in TICPPV1 and from lurking
the NG, and a little diddling around on my own, looks like a really crappy
excuse for the power of C++.
After poking around a bit with g++ and QT, I came up with this:
------------<quote>--------------------------
$ cat metric_conversion.ui.h
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
#include <qvalidator.h>
// Added by Rich:
#include <iostream>
#include <string>
using namespace std;
void ConversionForm::init()
{
// Added by Rich:
cout << "Conversion Form Initializing" << endl;
numberLineEdit->setValidator( new QDoubleValidator( numberLineEdit ) );
numberLineEdit->setText( "10" );
convert();
numberLineEdit->selectAll();
}
// Added by Rich:
void ConversionForm::destroy()
{
cout << "Conversion Form Being Removed" << endl;
}
void ConversionForm::convert()
{
// Changed from "Kilometers", etc, to "km" etc
enum MetricUnits {
km,
m,
cm,
mm
};
enum OldUnits {
Mi,
Yd,
Ft,
In
};
// Retrieve the input
double input = numberLineEdit->text().toDouble();
double scaledInput = input;
// internally convert the input to millimeters
// added this line - the string is my idea
string FromUnits = "mm";
switch ( fromComboBox->currentItem() ) {
case km:
scaledInput *= 1000000;
FromUnits = "km"; // this, and those below, make it
break; // easy to report, below
case m:
scaledInput *= 1000;
FromUnits = "m";
break;
case cm:
scaledInput *= 10;
FromUnits = "cm";
break;
}
//convert to inches
double result = scaledInput * 0.0393701;
// like the above, for reporting
string ToUnits = "In";
switch ( toComboBox->currentItem() ) {
case Mi:
result /= 63360;
ToUnits = "Mi";
break;
case Yd:
result /= 36;
ToUnits = "Yd";
break;
case Ft:
result /= 12;
ToUnits = "Ft";
break;
}
// set the result
int decimals = decimalsSpinBox->value();
resultLineEdit->setText( QString::number( result, 'f', decimals ) );
numberLineEdit->setText( QString::number( input, 'f', decimals ) );
// I've added this part just to see console I/O simultaneously with pushing
// buttons and schtuff. What a geek-gasm!
cout << numberLineEdit->text().toDouble() << " " << FromUnits
<< " = " << resultLineEdit->text().toDouble() << " " << ToUnits <<"." << endl;
}
--------------------</quote>-----------------
So, anyways, I wanted to show off my accomplishment: the executable is at
the link above, and here:
http://www.abiengr.com/~sysop/Share/metric - it's an ELF 32-bit
executable, but I don't know if you need QT installed on your machine. I'd
think anybody running any reasonable distro with X up should be able to
D/L that and just run it. In fact, I'd be very, very interested to hear
of anyone's experiences running it - it doesn't have any malware, unless
g++ or qmake or make put it there. ;-)
Oh, it was also kewl to look at some of the XML and comprehend it. ;-)
OK, on proofreading - do my new strings get deleted when I fall out of
scope, or should I explicitly delete them in the destructor? If I got what
I think I read, they automatically get destructed, since they're
created locally, the compiler automatically destructs them when I
leave the scope normally, is this accurate?
Still proofreading - I'd like to granularize that scale factor schtuff -
like come up with one scale factor, so that convert() only had to go
output = input * scalefactor; but I need some more learning about
objects and stuff - I'm somewhat disappointed, or don't know where to
look, that the dropdown box doesn't seem to have a property where I can
retrieve its item's text. Oh, well, At least I got it going the way I
want it to, except for the fact that when I hit "enter" on the text
input box, it clears the box. I don't know how to not make it do that.
Wanna see the XML of the form? Well, it's only a text NG, and this
is the last part of the post, so you can skip it if you want:
----------------<quote>-------------------------
$ cat metric_conversion.ui
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ConversionForm</class>
<widget class="QDialog">
<property name="name">
<cstring>ConversionForm</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>402</width>
<height>127</height>
</rect>
</property>
<property name="caption">
<string>Metric -> Inches Conversion</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout8</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLineEdit">
<property name="name">
<cstring>numberLineEdit</cstring>
</property>
<property name="alignment">
<set>AlignAuto</set>
</property>
<property name="toolTip" stdset="0">
<string>Metric Value</string>
</property>
<property name="whatsThis" stdset="0">
<string>Input your measurement here, and select units km, m, cm, or mm on the drop-down box to the right.</string>
</property>
</widget>
<widget class="QComboBox">
<item>
<property name="text">
<string>km</string>
</property>
</item>
<item>
<property name="text">
<string>m</string>
</property>
</item>
<item>
<property name="text">
<string>cm</string>
</property>
</item>
<item>
<property name="text">
<string>mm</string>
</property>
</item>
<property name="name">
<cstring>fromComboBox</cstring>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="text">
<string>=</string>
</property>
<property name="buddy" stdset="0">
<cstring>fromComboBox</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>resultLineEdit</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="paletteBackgroundColor">
<color>
<red>255</red>
<green>255</green>
<blue>127</blue>
</color>
</property>
<property name="alignment">
<set>AlignRight</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox">
<item>
<property name="text">
<string>Mi</string>
</property>
</item>
<item>
<property name="text">
<string>Yd</string>
</property>
</item>
<item>
<property name="text">
<string>Ft</string>
</property>
</item>
<item>
<property name="text">
<string>In</string>
</property>
</item>
<property name="name">
<cstring>toComboBox</cstring>
</property>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout5</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel5</cstring>
</property>
<property name="text">
<string>&Precision</string>
</property>
<property name="buddy" stdset="0">
<cstring>decimalsSpinBox</cstring>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>170</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QSpinBox">
<property name="name">
<cstring>decimalsSpinBox</cstring>
</property>
<property name="maxValue">
<number>6</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Decimal Places</string>
</property>
</widget>
</hbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer3</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout3</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QPushButton">
<property name="name">
<cstring>clearPushButton</cstring>
</property>
<property name="text">
<string>&Clear</string>
</property>
<property name="accel">
<string>Alt+C</string>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>calcluatePushButton</cstring>
</property>
<property name="text">
<string>Calculate</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>41</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>quitPushButton</cstring>
</property>
<property name="text">
<string>&Quit</string>
</property>
<property name="accel">
<string>Alt+Q</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>clearPushButton</sender>
<signal>clicked()</signal>
<receiver>numberLineEdit</receiver>
<slot>clear()</slot>
</connection>
<connection>
<sender>clearPushButton</sender>
<signal>clicked()</signal>
<receiver>resultLineEdit</receiver>
<slot>clear()</slot>
</connection>
<connection>
<sender>clearPushButton</sender>
<signal>clicked()</signal>
<receiver>numberLineEdit</receiver>
<slot>setFocus()</slot>
</connection>
<connection>
<sender>quitPushButton</sender>
<signal>clicked()</signal>
<receiver>ConversionForm</receiver>
<slot>close()</slot>
</connection>
<connection>
<sender>calcluatePushButton</sender>
<signal>clicked()</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>decimalsSpinBox</sender>
<signal>valueChanged(int)</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>fromComboBox</sender>
<signal>textChanged(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>toComboBox</sender>
<signal>textChanged(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>numberLineEdit</sender>
<signal>returnPressed()</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>numberLineEdit</sender>
<signal>lostFocus()</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>fromComboBox</sender>
<signal>activated(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>toComboBox</sender>
<signal>activated(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
</connections>
<tabstops>
<tabstop>numberLineEdit</tabstop>
<tabstop>fromComboBox</tabstop>
<tabstop>resultLineEdit</tabstop>
<tabstop>toComboBox</tabstop>
<tabstop>decimalsSpinBox</tabstop>
<tabstop>clearPushButton</tabstop>
<tabstop>calcluatePushButton</tabstop>
<tabstop>quitPushButton</tabstop>
</tabstops>
<includes>
<include location="local" impldecl="in implementation">metric_conversion.ui.h</include>
</includes>
<slots>
<slot>convert()</slot>
</slots>
<functions>
<function access="private" specifier="non virtual">init()</function>
<function access="private" specifier="non virtual">destroy()</function>
</functions>
<pixmapinproject/>
<layoutdefaults spacing="6" margin="11"/>
</UI>
--------------</quote>--------------------------
Thanks!
Rich
"Pure C++", and Slackware is a distro, but those guys are sharp.
And I've crossposted to sci.electroncs.design because I can. ;-P
Anyways, I want to crow about what I've done. I've been dabbling, kind of
poking away at the QT tutorials, but when I get to the "Now, write some
C++ to make it all go", I kinda hit a railroad crossing. ;-) So, I
downloaded "Thinking in C++", and actually printed it on dead tree paper,
and took it to bed with me to read myself to sleep. ;-) (it's about 4"
thick, overall, printed single-sided on 20# letter-size. ;-) ) I really
like the way that they mention, "Answers to the exercises are available
for a nominal fee..."
So, anyways, I'm sitting here, kind of bored because there's no work and
it really only takes a couple of hours to catch up on a day's worth
of internet, and something bit me behind the knees, and I hauled out the
ol' QT tutorial again, and popped up TICPPV1.pdf on another window, and
in about an hour I'd produced:
http://www.abiengr.com/~sysop/Share/metric
It doesnt' have any viruses, unless Gnu g++ put them there:
$ file metric
metric: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
(I didn't wrap this, but it's not that important).
But it's different from what came in the QT tutorial:
---------------<quote>---------------------
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 ) );
}
--------------<end quote>--------------------
Which, quite frankly, based on what I've read in TICPPV1 and from lurking
the NG, and a little diddling around on my own, looks like a really crappy
excuse for the power of C++.
After poking around a bit with g++ and QT, I came up with this:
------------<quote>--------------------------
$ cat metric_conversion.ui.h
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
#include <qvalidator.h>
// Added by Rich:
#include <iostream>
#include <string>
using namespace std;
void ConversionForm::init()
{
// Added by Rich:
cout << "Conversion Form Initializing" << endl;
numberLineEdit->setValidator( new QDoubleValidator( numberLineEdit ) );
numberLineEdit->setText( "10" );
convert();
numberLineEdit->selectAll();
}
// Added by Rich:
void ConversionForm::destroy()
{
cout << "Conversion Form Being Removed" << endl;
}
void ConversionForm::convert()
{
// Changed from "Kilometers", etc, to "km" etc
enum MetricUnits {
km,
m,
cm,
mm
};
enum OldUnits {
Mi,
Yd,
Ft,
In
};
// Retrieve the input
double input = numberLineEdit->text().toDouble();
double scaledInput = input;
// internally convert the input to millimeters
// added this line - the string is my idea
string FromUnits = "mm";
switch ( fromComboBox->currentItem() ) {
case km:
scaledInput *= 1000000;
FromUnits = "km"; // this, and those below, make it
break; // easy to report, below
case m:
scaledInput *= 1000;
FromUnits = "m";
break;
case cm:
scaledInput *= 10;
FromUnits = "cm";
break;
}
//convert to inches
double result = scaledInput * 0.0393701;
// like the above, for reporting
string ToUnits = "In";
switch ( toComboBox->currentItem() ) {
case Mi:
result /= 63360;
ToUnits = "Mi";
break;
case Yd:
result /= 36;
ToUnits = "Yd";
break;
case Ft:
result /= 12;
ToUnits = "Ft";
break;
}
// set the result
int decimals = decimalsSpinBox->value();
resultLineEdit->setText( QString::number( result, 'f', decimals ) );
numberLineEdit->setText( QString::number( input, 'f', decimals ) );
// I've added this part just to see console I/O simultaneously with pushing
// buttons and schtuff. What a geek-gasm!
cout << numberLineEdit->text().toDouble() << " " << FromUnits
<< " = " << resultLineEdit->text().toDouble() << " " << ToUnits <<"." << endl;
}
--------------------</quote>-----------------
So, anyways, I wanted to show off my accomplishment: the executable is at
the link above, and here:
http://www.abiengr.com/~sysop/Share/metric - it's an ELF 32-bit
executable, but I don't know if you need QT installed on your machine. I'd
think anybody running any reasonable distro with X up should be able to
D/L that and just run it. In fact, I'd be very, very interested to hear
of anyone's experiences running it - it doesn't have any malware, unless
g++ or qmake or make put it there. ;-)
Oh, it was also kewl to look at some of the XML and comprehend it. ;-)
OK, on proofreading - do my new strings get deleted when I fall out of
scope, or should I explicitly delete them in the destructor? If I got what
I think I read, they automatically get destructed, since they're
created locally, the compiler automatically destructs them when I
leave the scope normally, is this accurate?
Still proofreading - I'd like to granularize that scale factor schtuff -
like come up with one scale factor, so that convert() only had to go
output = input * scalefactor; but I need some more learning about
objects and stuff - I'm somewhat disappointed, or don't know where to
look, that the dropdown box doesn't seem to have a property where I can
retrieve its item's text. Oh, well, At least I got it going the way I
want it to, except for the fact that when I hit "enter" on the text
input box, it clears the box. I don't know how to not make it do that.
Wanna see the XML of the form? Well, it's only a text NG, and this
is the last part of the post, so you can skip it if you want:
----------------<quote>-------------------------
$ cat metric_conversion.ui
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ConversionForm</class>
<widget class="QDialog">
<property name="name">
<cstring>ConversionForm</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>402</width>
<height>127</height>
</rect>
</property>
<property name="caption">
<string>Metric -> Inches Conversion</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout8</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLineEdit">
<property name="name">
<cstring>numberLineEdit</cstring>
</property>
<property name="alignment">
<set>AlignAuto</set>
</property>
<property name="toolTip" stdset="0">
<string>Metric Value</string>
</property>
<property name="whatsThis" stdset="0">
<string>Input your measurement here, and select units km, m, cm, or mm on the drop-down box to the right.</string>
</property>
</widget>
<widget class="QComboBox">
<item>
<property name="text">
<string>km</string>
</property>
</item>
<item>
<property name="text">
<string>m</string>
</property>
</item>
<item>
<property name="text">
<string>cm</string>
</property>
</item>
<item>
<property name="text">
<string>mm</string>
</property>
</item>
<property name="name">
<cstring>fromComboBox</cstring>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="text">
<string>=</string>
</property>
<property name="buddy" stdset="0">
<cstring>fromComboBox</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>resultLineEdit</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="paletteBackgroundColor">
<color>
<red>255</red>
<green>255</green>
<blue>127</blue>
</color>
</property>
<property name="alignment">
<set>AlignRight</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox">
<item>
<property name="text">
<string>Mi</string>
</property>
</item>
<item>
<property name="text">
<string>Yd</string>
</property>
</item>
<item>
<property name="text">
<string>Ft</string>
</property>
</item>
<item>
<property name="text">
<string>In</string>
</property>
</item>
<property name="name">
<cstring>toComboBox</cstring>
</property>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout5</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel5</cstring>
</property>
<property name="text">
<string>&Precision</string>
</property>
<property name="buddy" stdset="0">
<cstring>decimalsSpinBox</cstring>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>170</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QSpinBox">
<property name="name">
<cstring>decimalsSpinBox</cstring>
</property>
<property name="maxValue">
<number>6</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Decimal Places</string>
</property>
</widget>
</hbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer3</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout3</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QPushButton">
<property name="name">
<cstring>clearPushButton</cstring>
</property>
<property name="text">
<string>&Clear</string>
</property>
<property name="accel">
<string>Alt+C</string>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>calcluatePushButton</cstring>
</property>
<property name="text">
<string>Calculate</string>
</property>
<property name="accel">
<string></string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>41</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>quitPushButton</cstring>
</property>
<property name="text">
<string>&Quit</string>
</property>
<property name="accel">
<string>Alt+Q</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>clearPushButton</sender>
<signal>clicked()</signal>
<receiver>numberLineEdit</receiver>
<slot>clear()</slot>
</connection>
<connection>
<sender>clearPushButton</sender>
<signal>clicked()</signal>
<receiver>resultLineEdit</receiver>
<slot>clear()</slot>
</connection>
<connection>
<sender>clearPushButton</sender>
<signal>clicked()</signal>
<receiver>numberLineEdit</receiver>
<slot>setFocus()</slot>
</connection>
<connection>
<sender>quitPushButton</sender>
<signal>clicked()</signal>
<receiver>ConversionForm</receiver>
<slot>close()</slot>
</connection>
<connection>
<sender>calcluatePushButton</sender>
<signal>clicked()</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>decimalsSpinBox</sender>
<signal>valueChanged(int)</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>fromComboBox</sender>
<signal>textChanged(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>toComboBox</sender>
<signal>textChanged(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>numberLineEdit</sender>
<signal>returnPressed()</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>numberLineEdit</sender>
<signal>lostFocus()</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>fromComboBox</sender>
<signal>activated(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
<connection>
<sender>toComboBox</sender>
<signal>activated(const QString&</signal>
<receiver>ConversionForm</receiver>
<slot>convert()</slot>
</connection>
</connections>
<tabstops>
<tabstop>numberLineEdit</tabstop>
<tabstop>fromComboBox</tabstop>
<tabstop>resultLineEdit</tabstop>
<tabstop>toComboBox</tabstop>
<tabstop>decimalsSpinBox</tabstop>
<tabstop>clearPushButton</tabstop>
<tabstop>calcluatePushButton</tabstop>
<tabstop>quitPushButton</tabstop>
</tabstops>
<includes>
<include location="local" impldecl="in implementation">metric_conversion.ui.h</include>
</includes>
<slots>
<slot>convert()</slot>
</slots>
<functions>
<function access="private" specifier="non virtual">init()</function>
<function access="private" specifier="non virtual">destroy()</function>
</functions>
<pixmapinproject/>
<layoutdefaults spacing="6" margin="11"/>
</UI>
--------------</quote>--------------------------
Thanks!
Rich