Qt:QSpinBox&QDoubleSpinBox 野性酷女 2023-01-12 11:46 100阅读 0赞 //显示整数 QSpinBox *spin = new QSpinBox(this); spin->setMinimum(10); spin->setMaximum(300); spin->setPrefix("$ "); spin->setValue(200); //设置默认值,必须在10-300之间,否则离10进就是10,离300进就是300 spin->setGeometry(10, 30, 100, 30); QDoubleSpinBox * doublespin = new QDoubleSpinBox(this); doublespin->setMinimum(10.0); doublespin->setMaximum(300.0); doublespin->setValue(50.5); doublespin->setSuffix(" mm"); doublespin->setGeometry(30 + 110, 30, 100, 30); //常用的信号:valueChanged(int),valueChanged(double) ![25fdfe52a6bfafab521bbe5d26dc64f74be.jpg][] [25fdfe52a6bfafab521bbe5d26dc64f74be.jpg]: /images/20221119/b4dcedefe1ee43dd95c37a65a8670c76.png
还没有评论,来说两句吧...