/*************************************************************************** * Copyright (C) 2008 by Peter Dahlberg * * pdahlberg@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "probechargewidget.h" #include "graphicsellipseitem.h" #include "expdoublespinbox.h" #include #include #include #include #include ProbeChargeWidget::ProbeChargeWidget ( QWidget* parent, Qt::WindowFlags f, GraphicsEllipseItem* ellipse ) : QWidget (parent, f ) { createWidget(); } ProbeChargeWidget::~ProbeChargeWidget() { } void ProbeChargeWidget::createWidget() { QDial *rotationDial = new QDial; rotationDial->setRange(0,359); rotationDial->setNotchesVisible(true); rotationDial->setWrapping(true); QDoubleSpinBox *heightBox = new QDoubleSpinBox; QDoubleSpinBox *widthBox = new QDoubleSpinBox; 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:")); QDoubleSpinBox *posXBox = new QDoubleSpinBox; posXBox->setRange(-5000, 5000); QDoubleSpinBox *posYBox = new QDoubleSpinBox; posYBox->setRange(-5000, 5000); QSpinBox* rotationBox = new QSpinBox; rotationBox->setRange(0,359); rotationBox->setSuffix("\260"); rotationBox->setWrapping(true); QGridLayout* geomGridLayout = new QGridLayout; //geomGridLayout->setSizeConstraint(QLayout::SetFixedSize); geomGridLayout->addWidget(heightBox,4,1); geomGridLayout->addWidget(rotationBox,0,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(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:")); ExpDoubleSpinBox* fieldPowerBox = new ExpDoubleSpinBox; fieldPowerBox->setRange(-1e+200,1e+200); ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox; voltageBox->setRange(-1e+200,1e+200); 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); QGroupBox* fieldConstantsBox = new QGroupBox(tr("Feldkonstanten")); fieldConstantsBox->setLayout(constGridLayout); QVBoxLayout * mainLayout = new QVBoxLayout(this); mainLayout -> addWidget(geometryBox); mainLayout -> addWidget(fieldConstantsBox); mainLayout -> addStretch(); QWidget::setTabOrder (rotationBox, posXBox); QWidget::setTabOrder (posXBox, posYBox); QWidget::setTabOrder (posYBox, widthBox); QWidget::setTabOrder (widthBox, heightBox); this -> setLayout(mainLayout); }