QDoubleSpinBox 继承图:

PyQt5 控件学习(一个一个学习之QDoubleSpinBox)

QDoubleSpinBox 描述:

PyQt5 控件学习(一个一个学习之QDoubleSpinBox)

它和QSpinBox 的整型差不多,无非就是整型和  浮点的区别,

但是它们并非继承关系 

 

QDoubleSpinBox 继承:

它的父类是QAbstractSpinBox  

 

QDoubleSpinBox 功能作用:

QDoubleSpinBox 功能作用之构造函数:

from PyQt5.Qt import * #刚开始学习可以这样一下导入
import sys

class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("QDoubleSpinBox的学习")
        self.resize(400,400)
        self.set_ui()


    def set_ui(self):
        doubleSpinBox = QDoubleSpinBox(self)
        doubleSpinBox.resize(100,30)
        doubleSpinBox.move(100,30)
        # 它的默认的取值范围是 0.00- 99.00


if __name__ == '__main__':
    app =QApplication(sys.argv)

    window = Window()
    window.show()

    sys.exit(app.exec_())
View Code

相关文章: