花了几天时间学习了PyQt5的常用组件及页面布局,现总结如下
借用网上的图
界面一
主要用到的布局器:QVBoxLayout,QHBoxLayout
主要组件:QPushButton,QLabel,QDoubleSpinBox,QLineEdit
self.form_v1 = QWidget()
self.formLayout1 = QVBoxLayout(self.form_v1)
self.h11 = QWidget()
self.formLayout_h11 = QHBoxLayout(self.h11)
self.h12 = QWidget()
self.formLayout_h12 = QHBoxLayout(self.h12)
self.btn_tf1 = QPushButton("tf")
self.btn_tf1.clicked.connect(self.tf_start)
self.x_show = QLabel()
self.x_show.setText("x")
self.x_spin = QDoubleSpinBox()
self.x_spin.setRange(0.0,5.0)
self.x_spin.setValue(0.5)
self.x_spin.setSingleStep(0.1)
self.y_show = QLabel()
self.y_show.setText("y")
self.y_spin = QDoubleSpinBox()
self.y_spin.setRange(0.0, 5.0)
self.y_spin.setSingleStep(0.1)
self.y_spin.setValue(0.5)
self.z_show = QLabel()
self.z_show.setText("z")
self.z_spin = QDoubleSpinBox()
self.z_spin.setRange(0.0, 5.0)
self.z_spin.setSingleStep(0.1)
self.z_spin.setValue(0.5)
self.btn_tf2 = QPushButton("world2map")
self.btn_tf2.clicked.connect(self.tf_transfer)
self.showTf = QLineEdit(" ")
self.label1 = QLabel