Quisiera saber como puedo ir llenando un formulario diseñado en PyQt y al presionar la tecla enter salte al siguiente QlineEdit
#Clase heredada de QMainWindow (Constructor de ventanas)
class VentanaFresado(QDialog):
#Metodo constructor de la clase
def __init__(self):
#Iniciar el objeto QMainWindow
QDialog.__init__(self)
#Cargar la configuracion del archivo .ui en el objeto
uic.loadUi("DialogFresado.ui", self)
self.setWindowTitle("Calculos Fresado")
self.btn_calcular.clicked.connect(self.btn_calcular_clicked)
#evento del boton btn_calcular
def btn_calcular_clicked(self):
var_diamherr = float(self.txt_diamhta.text())
var_rpm = float(self.txt_rpm.text())
var_vc = float(self.txt_vc.text())
if var_diamherr >= 1 and var_rpm >= 1 and var_vc == 0 :
vel_corte = ((var_diamherr * 3.1416 * var_rpm)/(1000))
self.txt_vc.setText (str(round(vel_corte,2)))
elif var_vc >= 1 and var_diamherr >= 1 and var_rpm == 0 :
rpm = ((var_vc * 1000)/(3.1416 * var_diamherr))
self.txt_rpm.setText (str(round(rpm,2)))
#Instancia para iniciar una aplicacion
app = QApplication(sys.argv)
#Crear un objeto de la clase
ventana2 = VentanaFresado()
#Mostra la ventana
ventana2.show()
#Ejecutar la aplicacion
app.exec_()
DialogFresado.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogFresado</class>
<widget class="QDialog" name="DialogFresado">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>500</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>500</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>500</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>40</x>
<y>30</y>
<width>100</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Diametro Hta</string>
</property>
</widget>
<widget class="QLineEdit" name="txt_diamhta">
<property name="geometry">
<rect>
<x>40</x>
<y>50</y>
<width>60</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">font: italic 8pt "Arial";
color: rgb(0, 0, 0);
</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>40</x>
<y>80</y>
<width>100</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>RPM Husillo</string>
</property>
</widget>
<widget class="QLineEdit" name="txt_rpm">
<property name="geometry">
<rect>
<x>40</x>
<y>100</y>
<width>60</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">font: italic 8pt "Arial";
color: rgb(0, 0, 0);
</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>40</x>
<y>130</y>
<width>100</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Vel Corte</string>
</property>
</widget>
<widget class="QLineEdit" name="txt_vc">
<property name="geometry">
<rect>
<x>40</x>
<y>150</y>
<width>60</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">font: italic 8pt "Arial";
color: rgb(0, 0, 0);
</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>110</x>
<y>50</y>
<width>50</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>9</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">font: 75 8pt "Arial";
</string>
</property>
<property name="text">
<string>mm</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>110</x>
<y>100</y>
<width>50</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>9</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">font: 75 8pt "Arial";
</string>
</property>
<property name="text">
<string>RPM</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>110</x>
<y>150</y>
<width>50</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>9</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">font: 75 8pt "Arial";
</string>
</property>
<property name="text">
<string>m/min</string>
</property>
</widget>
<widget class="QPushButton" name="btn_calcular">
<property name="geometry">
<rect>
<x>40</x>
<y>190</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Calcular</string>
</property>
</widget>
<widget class="QPushButton" name="btn_borrar">
<property name="geometry">
<rect>
<x>120</x>
<y>190</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Borrar</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>