viel zeugs usw.

git-svn-id: http://svn.lsim.tuxzone.org/trunk@11 4bec179b-ab65-46ed-a5f8-55b8b5c735d0
This commit is contained in:
catdog2
2008-11-06 21:05:13 +00:00
parent 1f68e40c77
commit c8ca381faa
9 changed files with 130 additions and 60 deletions

View File

@@ -27,6 +27,7 @@
#include <QLabel>
ProbeChargeWidget::ProbeChargeWidget ( QWidget* parent, Qt::WindowFlags f, GraphicsEllipseItem* ellipse ) : QWidget (parent, f ) {
ellipseItem = ellipse;
createWidget();
}
@@ -43,72 +44,90 @@ void ProbeChargeWidget::createWidget()
rotationDial->setWrapping(true);
QDoubleSpinBox *heightBox = new QDoubleSpinBox;
ExpDoubleSpinBox *startSpeedYBox = new ExpDoubleSpinBox;
startSpeedYBox->setDecimals(50);
startSpeedYBox->setDisplayDecimals(3);
startSpeedYBox->setRange(-3e+8, 3e+8);
startSpeedYBox->setKeyboardTracking(false);
connect(startSpeedYBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setStartSpeedY(double)) );
connect(ellipseItem, SIGNAL(startSpeedYChanged(double)), startSpeedYBox, SLOT(setValue(double)) );
QDoubleSpinBox *widthBox = new QDoubleSpinBox;
ExpDoubleSpinBox *startSpeedXBox = new ExpDoubleSpinBox;
startSpeedXBox->setDecimals(50);
startSpeedXBox->setDisplayDecimals(3);
startSpeedXBox->setRange(-3e+8, 3e+8);
startSpeedXBox->setKeyboardTracking(false);
connect(startSpeedXBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setStartSpeedX(double)) );
connect(ellipseItem, SIGNAL(startSpeedXChanged(double)), startSpeedXBox, SLOT(setValue(double)) );
QLabel* xLabel = new QLabel(tr("x:"));
QLabel* yLabel = new QLabel(tr("y:"));
QLabel* widthLabel = new QLabel(tr("Breite(l):"));
QLabel* heightLabel = new QLabel(tr("H\366he(d):"));
QLabel* rotationLabel = new QLabel(tr("Rotation:"));
QLabel* startSpeedYLabel = new QLabel(tr("Startgeschwindigkeit y:"));
QLabel* startSpeedXLabel = new QLabel(tr("Startgeschwindigkeit x:"));
QDoubleSpinBox *posXBox = new QDoubleSpinBox;
posXBox->setRange(-5000, 5000);
posXBox->setKeyboardTracking(false);
connect(posXBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setScenePosX(double)) );
connect(ellipseItem, SIGNAL(ScenePosXChanged(double)), posXBox, SLOT(setValue(double)) );
QDoubleSpinBox *posYBox = new QDoubleSpinBox;
posYBox->setRange(-5000, 5000);
QSpinBox* rotationBox = new QSpinBox;
rotationBox->setRange(0,359);
rotationBox->setSuffix("\260");
rotationBox->setWrapping(true);
posYBox->setKeyboardTracking(false);
connect(posYBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setScenePosY(double)) );
connect(ellipseItem, SIGNAL(ScenePosYChanged(double)), posYBox, SLOT(setValue(double)) );
QGridLayout* geomGridLayout = new QGridLayout;
//geomGridLayout->setSizeConstraint(QLayout::SetFixedSize);
geomGridLayout->addWidget(heightBox,4,1);
geomGridLayout->addWidget(rotationBox,0,1);
geomGridLayout->addWidget(startSpeedYBox,4,1);
geomGridLayout->addWidget(posYBox,2,1);
geomGridLayout->addWidget(posXBox,1,1);
geomGridLayout->addWidget(xLabel,1,0,Qt::AlignRight);
geomGridLayout->addWidget(yLabel,2,0,Qt::AlignRight);
geomGridLayout->addWidget(heightLabel,4,0,Qt::AlignRight);
geomGridLayout->addWidget(widthLabel,3,0,Qt::AlignRight);
geomGridLayout->addWidget(rotationLabel,0,0,Qt::AlignRight);
geomGridLayout->addWidget(widthBox,3,1);
geomGridLayout->addWidget(startSpeedYLabel,4,0,Qt::AlignRight);
geomGridLayout->addWidget(startSpeedXLabel,3,0,Qt::AlignRight);
geomGridLayout->addWidget(startSpeedXBox,3,1);
//geomGridLayout->addWidget(rotationDial, 1,0,2,2);
QGroupBox* geometryBox = new QGroupBox(tr("Geometrie"));
geometryBox->setLayout(geomGridLayout);
QLabel* fieldPowerLabel = new QLabel(tr("Feldst\344rke:"));
QLabel* voltageLabel = new QLabel(tr("Spannung:"));
QLabel* chargeLabel = new QLabel(tr("Ladung:"));
QLabel* masseLabel = new QLabel(tr("Masse:"));
ExpDoubleSpinBox* fieldPowerBox = new ExpDoubleSpinBox;
fieldPowerBox->setRange(-1e+200,1e+200);
ExpDoubleSpinBox* chargeBox = new ExpDoubleSpinBox;
chargeBox->setRange(-1e+200,1e+200);
chargeBox->setDecimals(50);
chargeBox->setDisplayDecimals(3);
chargeBox->setKeyboardTracking(false);
chargeBox->setSuffix(" As");
connect(chargeBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setCharge(double)) );
connect(ellipseItem, SIGNAL(chargeChanged(double)), chargeBox, SLOT(setValue(double)) );
ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox;
voltageBox->setRange(-1e+200,1e+200);
ExpDoubleSpinBox* masseBox = new ExpDoubleSpinBox;
masseBox->setRange(-1e+200,1e+200);
masseBox->setDecimals(50);
masseBox->setDisplayDecimals(3);
masseBox->setKeyboardTracking(false);
masseBox->setSuffix(" kg");
connect(masseBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setMasse(double)) );
connect(ellipseItem, SIGNAL(masseChanged(double)), masseBox, SLOT(setValue(double)) );
QGridLayout* constGridLayout = new QGridLayout;
//constGridLayout->setSizeConstraint(QLayout::SetFixedSize);
constGridLayout->addWidget(fieldPowerBox,0,1);
constGridLayout->addWidget(voltageBox,1,1);
constGridLayout->addWidget(fieldPowerLabel,0,0,Qt::AlignRight);
constGridLayout->addWidget(voltageLabel,1,0,Qt::AlignRight);
constGridLayout->addWidget(chargeBox,0,1);
constGridLayout->addWidget(masseBox,1,1);
constGridLayout->addWidget(chargeLabel,0,0,Qt::AlignRight);
constGridLayout->addWidget(masseLabel,1,0,Qt::AlignRight);
QGroupBox* fieldConstantsBox = new QGroupBox(tr("Feldkonstanten"));
QGroupBox* fieldConstantsBox = new QGroupBox(tr("Konstanten"));
fieldConstantsBox->setLayout(constGridLayout);
@@ -117,10 +136,9 @@ void ProbeChargeWidget::createWidget()
mainLayout -> addWidget(fieldConstantsBox);
mainLayout -> addStretch();
QWidget::setTabOrder (rotationBox, posXBox);
QWidget::setTabOrder (posXBox, posYBox);
QWidget::setTabOrder (posYBox, widthBox);
QWidget::setTabOrder (widthBox, heightBox);
QWidget::setTabOrder (posYBox, startSpeedYBox);
QWidget::setTabOrder (startSpeedYBox, startSpeedXBox);
this -> setLayout(mainLayout);
}