Qt:QProgressBar 约定不等于承诺〃 2023-01-12 11:47 97阅读 0赞 1、新建QT GUI,取消创建界面,基类选择“QWidget” 2、构造函数中: QProgressBar *progress[4]; progress[0] = new QProgressBar(this); progress[0]->setMinimum(0); progress[0]->setMaximum(100); progress[0]->setValue(50); //设置默认值 progress[0]->setOrientation(Qt::Horizontal); //水平放置 progress[1] = new QProgressBar(this); progress[1]->setMinimum(0); progress[1]->setMaximum(100); progress[1]->setValue(70); progress[1]->setOrientation(Qt::Horizontal); progress[1]->setInvertedAppearance(true); //反转方向 progress[2] = new QProgressBar(this); progress[2]->setMinimum(0); progress[2]->setMaximum(100); progress[2]->setValue(70); progress[2]->setOrientation(Qt::Vertical); //垂直放置 progress[3] = new QProgressBar(this); progress[3]->setMinimum(0); progress[3]->setMaximum(100); progress[3]->setValue(70); progress[3]->setOrientation(Qt::Vertical); progress[3]->setInvertedAppearance(true); progress[0]->setGeometry(10,30, 300, 30); progress[1]->setGeometry(10,70, 300, 30); progress[2]->setGeometry(400,30, 30, 300); progress[3]->setGeometry(440,30, 30, 300); ![1568545bec9747dc078dac2c23ff53fdf18.jpg][] [1568545bec9747dc078dac2c23ff53fdf18.jpg]: /images/20221119/b40e04c60e4c4c7399fa75fa24cda511.png
还没有评论,来说两句吧...